/* ============================================================
   results.css — 学员成果页面专属样式
   依赖 style.css 中的 CSS Variables 和公共组件
   ============================================================ */

/* page-hero 公共样式已移至 style.css */

/* ============================================================
   Main Content Background
   ============================================================ */
.results-main {
  background: #f8f8f8;
  padding: 60px 0 80px;
}

/* ============================================================
   Two-column layout: sidebar + content
   ============================================================ */
.results-layout {
  display: flex;
  gap: clamp(20px, 3.8vw, 53px);
  align-items: flex-start;
}

/* ============================================================
   Left Sidebar
   ============================================================ */
.results-sidebar {
  width: clamp(220px, 20.4%, 283px);
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--nav-h) + 20px);
}

.sidebar-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 2px 20px rgba(0,0,0,.06);
}

/* Blue Header */
.sidebar-header {
  background: var(--primary);
  min-height: 97px;
  display: flex;
  align-items: center;
  padding: 0 24px;
  font-family: var(--font-cn);
  font-weight: 700;
  font-size: clamp(24px, 2.5vw, 36px);
  color: #fff;
  letter-spacing: -.5px;
}

/* Category List */
.sidebar-cats {
  display: flex;
  flex-direction: column;
}

.cat-item {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 71px;
  padding: 0 16px 0 20px;
  cursor: pointer;
  border-bottom: 1px solid #d9d9d9;
  transition: background .25s, color .25s;
  position: relative;
}
a.cat-item {
  text-decoration: none;
  color: inherit;
  box-sizing: border-box;
  width: 100%;
}
.cat-item:last-child { border-bottom: none; }

.cat-item.active {
  background: #e5f7ff;
}
.cat-item:not(.active):hover {
  background: rgba(14,165,233,.05);
}

/* Bullet dot */
.cat-dot {
  width: 9px;
  height: 9px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cat-dot img {
  width: 9px;
  height: 9px;
  object-fit: contain;
}

/* Category name */
.cat-name {
  flex: 1;
  font-family: var(--font-cn);
  font-size: clamp(15px, 1.3vw, 20px);
  color: #666;
  line-height: 1.4;
  transition: color .25s;
}
.cat-item.active .cat-name { color: var(--primary); font-weight: 500; }
.cat-item:not(.active):hover .cat-name { color: var(--text); }

/* Arrow icon */
.cat-arrow {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .3s;
}
.cat-arrow img {
  width: 12px;
  height: auto;
  object-fit: contain;
}
.cat-item.active .cat-arrow { transform: rotate(0deg); }
.cat-item:hover .cat-arrow  { transform: translateX(3px); }

/* Mobile category tabs */
.sidebar-tabs {
  display: none;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.sidebar-tabs::-webkit-scrollbar { display: none; }
.sidebar-tab {
  flex-shrink: 0;
  padding: 8px 20px;
  background: #fff;
  border: 1.5px solid var(--border-c);
  border-radius: 9999px;
  font-family: var(--font-cn);
  font-size: 15px;
  color: var(--text);
  cursor: pointer;
  transition: all .25s;
  white-space: nowrap;
  text-decoration: none;
  display: inline-block;
  box-sizing: border-box;
}
.sidebar-tab.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ============================================================
   Right Content Area
   ============================================================ */
.results-content {
  flex: 1;
  min-width: 0;
}

/* ============================================================
   Result Item List
   ============================================================ */
.result-list {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.5vw, 16px);
}

.result-item {
  background: #fff;
  border-radius: 10px;
  display: flex;
  overflow: hidden;
  min-height: 219px;
  transition: transform .3s var(--ease-spring, cubic-bezier(.34,1.56,.64,1)),
              box-shadow .3s;
}
.result-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 36px rgba(0,0,0,.12);
}

/* Thumbnail side */
.ri-thumb {
  width: clamp(180px, 25vw, 342px);
  flex-shrink: 0;
  padding: 17px 20px 17px 24px;
  overflow: hidden;
  background: var(--bg-gray);
}
.ri-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  transition: transform .5s ease;
}
.result-item:hover .ri-img { transform: scale(1.04); }

/* Info side */
.ri-info {
  flex: 1;
  min-width: 0;
  padding: clamp(16px, 2vw, 28px) clamp(16px, 2vw, 24px) clamp(16px, 2vw, 20px) clamp(12px, 1.5vw, 20px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.ri-title {
  font-family: var(--font-cn);
  font-weight: 500;
  font-size: clamp(18px, 2vw, 32px);
  color: #282828;
  line-height: 1.3;
  margin-bottom: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ri-desc {
  font-family: var(--font-cn);
  font-size: clamp(13px, 1.05vw, 14px);
  color: var(--text);
  line-height: 1.9;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ri-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.ri-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid rgba(14,165,233,.2);
  object-fit: cover;
  flex-shrink: 0;
  transition: border-color .25s;
}
.result-item:hover .ri-avatar { border-color: rgba(14,165,233,.5); }
.ri-author {
  font-family: var(--font-cn);
  font-size: 14px;
  color: #000;
}

/* ============================================================
   Pagination
   ============================================================ */
.pagination-wrap {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}
.pagination-meta {
  margin: 0;
  font-family: var(--font-cn);
  font-size: 14px;
  color: #64748b;
  letter-spacing: .02em;
}
.pagination-meta__cur {
  font-weight: 700;
  color: #0284c7;
}
.pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: clamp(12px, 2vw, 28px);
  margin-top: 0;
  padding: 0;
}

.page-item {
  font-family: var(--font-cn);
  font-weight: 500;
  font-size: 16px;
  color: #000;
  cursor: pointer;
  position: relative;
  padding-bottom: 6px;
  background: none;
  border: none;
  outline: none;
  transition: color .25s, transform .25s;
  line-height: 1;
}
a.page-item {
  text-decoration: none;
  display: inline-block;
}
.page-item::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 21px;
  height: 3px;
  background: #0284c7;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .3s ease;
}
.page-item.active {
  color: #0284c7;
  font-weight: 700;
}
.page-item.active::after { transform: scaleX(1); }
.page-item:not(.active):hover {
  color: var(--primary);
  transform: translateY(-2px);
}
.page-item--nav {
  font-size: 15px;
  padding-bottom: 4px;
  min-width: auto;
}
.page-item--nav::after {
  width: 100%;
  max-width: 64px;
}
.page-item--disabled {
  color: #94a3b8;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}
.page-item--disabled::after {
  display: none;
}
.page-ellipsis {
  font-family: var(--font-cn);
  font-size: 16px;
  color: #94a3b8;
  padding: 0 2px;
  user-select: none;
  pointer-events: none;
  line-height: 1;
  padding-bottom: 6px;
}
.project-pagination:empty {
  display: none;
}

.result-item-link {
  display: block;
  text-decoration: none;
  color: inherit;
  border-radius: 10px;
  transition: transform .25s ease, box-shadow .25s ease;
}
.result-item-link:hover { text-decoration: none; color: inherit; }
.result-item-link:focus-visible {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}
.detail-nav-muted {
  color: #94a3b8;
}

/* 列表滚动显现（与卡片基础样式分列，避免覆盖 flex/背景） */
.result-list .result-item {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .6s ease, transform .6s ease,
              box-shadow .3s,
              transform .3s var(--ease-spring, cubic-bezier(.34,1.56,.64,1));
}
.result-list .result-item.ri-visible {
  opacity: 1;
  transform: translateY(0);
}
.result-list .result-item.ri-visible:hover {
  transform: translateY(-4px);
}

/* ============================================================
   Responsive — Tablet ≤ 900px
   ============================================================ */
@media (max-width: 900px) {
  .results-layout {
    flex-direction: column;
    gap: 24px;
  }
  .results-sidebar {
    width: 100%;
    position: static;
  }
  /* On tablet, show as horizontal tabs */
  .sidebar-card { display: none; }
  .sidebar-tabs { display: flex; }

  .ri-thumb {
    width: clamp(160px, 30vw, 260px);
    padding: 12px 16px 12px 16px;
  }
}

/* ============================================================
   Responsive — Mobile ≤ 640px
   ============================================================ */
@media (max-width: 640px) {
  .result-item {
    flex-direction: column;
    min-height: auto;
  }
  .ri-thumb {
    width: 100%;
    height: 200px;
    padding: 0;
  }
  .ri-img { border-radius: 10px 10px 0 0; }
  .ri-info { padding: 16px; }
  .ri-title { font-size: clamp(16px, 5vw, 22px); white-space: normal; }

  .pagination-wrap { margin-top: 28px; }
  .pagination { gap: 14px; justify-content: flex-start; }
  .page-item--nav { font-size: 14px; }
}
