/* ============================================================
   作品集页 · 项目封面卡片（v2）
   - 版心与详情页一致（--detail-width）
   - 左侧介绍收窄、字号缩小
   - 右侧图片：主封面 + 两张斜放叠压的小卡片，悬停时散开
   在 works.html 中最后加载，覆盖 styles.css / site-theme.css 中的旧样式
   ============================================================ */

.works-page .content-shell { width: min(var(--detail-width), calc(100% - 40px)); }
.works-summary { display: none; }

/* ---------- 分类 Tab：下划线文字 Tab（区别于顶部胶囊导航） ---------- */
.featured-tabs.ui-segmented {
  display: flex;
  width: 100%;
  gap: 28px;
  margin-bottom: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: inset 0 -1px 0 var(--k-border);
}
.featured-tabs .ui-segmented__item {
  position: relative;
  min-height: 0;
  padding: 0 0 12px;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: var(--k-muted);
  font-family: var(--font-display);
  font-size: var(--fs-lead);
  font-weight: 500;
}
.featured-tabs .ui-segmented__item:hover { color: var(--k-ink); transform: none; }
.featured-tabs .ui-segmented__item.active {
  background: none;
  box-shadow: none;
  color: var(--k-ink);
  font-weight: 700;
}
.featured-tabs .ui-segmented__item::after {
  content: '';
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--k-ink);
  transform: scaleX(0);
  transition: transform .25s cubic-bezier(.22, 1, .36, 1);
}
.featured-tabs .ui-segmented__item.active::after { transform: scaleX(1); }
.featured-tabs .ui-segmented__item:focus-visible { outline: 2px solid rgba(35, 35, 35, .3); outline-offset: 4px; }
.featured-projects { min-height: 0; gap: 20px; }

/* ---------- 卡片 ---------- */
.featured-project {
  grid-template-columns: 300px minmax(0, 1fr);
  min-height: 400px;
  border-radius: var(--radius);
  background: var(--k-card);
  box-shadow: 0 1px 2px rgba(35, 35, 35, .04), 0 18px 40px -32px rgba(35, 35, 35, .35);
}
.featured-project:hover { box-shadow: 0 1px 2px rgba(35, 35, 35, .05), 0 24px 48px -30px rgba(35, 35, 35, .4); transform: translateY(-2px); }

/* ---------- 左侧介绍：更窄、更小 ---------- */
.featured-project-copy { padding: 36px 28px 32px 32px; }
.featured-project-meta { gap: 6px 12px; font-size: var(--fs-caption); letter-spacing: .14em; }
.featured-project-meta span { color: var(--k-subtle); }
.featured-project h2 {
  margin: 14px 0 10px;
  color: var(--k-ink);
  font-size: var(--fs-title);
  letter-spacing: -.02em;
  line-height: 1.25;
  word-break: keep-all;   /* 中文标题按词组换行，避免「香 / 港」这种断开 */
}
.featured-project-description {
  display: -webkit-box;
  max-width: none;
  overflow: hidden;
  color: var(--k-muted);
  font-size: var(--fs-body);
  line-height: 1.7;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.featured-project-tags { gap: 6px; margin-top: 16px; }
.featured-project-tags li {
  padding: 4px 10px;
  border: 1px solid var(--k-border);
  border-radius: var(--radius-pill);
  background: var(--k-surface);
  color: var(--k-muted);
  font-size: var(--fs-caption);
  font-weight: 600;
}
.featured-project-actions { gap: 8px; margin-top: 24px; }
.featured-project-actions .ui-button { min-height: 40px; padding: 0 16px; gap: 8px; font-size: var(--fs-body); }

/* ---------- 右侧图片：主封面 + 叠放小卡 ---------- */
.featured-project-gallery {
  position: relative;
  display: block;
  min-height: 400px;
  padding: 0;
  overflow: hidden;
  background: var(--k-surface);
}
.featured-project-gallery figure {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--k-border);
  box-shadow: 0 24px 40px -26px rgba(35, 35, 35, .45);
  transition: transform .5s cubic-bezier(.22, 1, .36, 1), box-shadow .5s;
}
.featured-project-gallery img { object-fit: cover; object-position: top center; }
/* 主封面：占据舞台左上，右下给小卡留位置 */
.featured-project-gallery .featured-project-cover {
  inset: 32px 92px 64px 32px;
  grid-column: auto;
}
/* 两张小卡：竖版，带白边，斜放叠在封面右下角 */
.featured-project-gallery figure:not(.featured-project-cover) {
  width: 116px;
  height: 156px;
  border: 3px solid #fff;
  background: #fff;
}
.featured-project-gallery figure:not(.featured-project-cover) img { border-radius: calc(var(--radius-sm) - 3px); }
.featured-project-gallery figure:nth-child(2) { right: 74px; bottom: 26px; transform: rotate(-6deg); z-index: 1; }
.featured-project-gallery figure:nth-child(3) { right: 22px; bottom: 50px; transform: rotate(5deg); z-index: 2; }
/* 悬停：封面轻微放大，小卡散开 */
.featured-project:hover .featured-project-cover { transform: scale(1.015); }
.featured-project:hover .featured-project-gallery figure:nth-child(2) { transform: translate(-14px, -6px) rotate(-10deg); }
.featured-project:hover .featured-project-gallery figure:nth-child(3) { transform: translate(6px, -14px) rotate(8deg); }

@media (max-width: 860px) {
  .featured-project { grid-template-columns: minmax(0, 1fr); min-height: 0; }
  .featured-project-gallery { min-height: 300px; }
}
@media (max-width: 767px) {
  .works-page .content-shell { width: 100%; }
  .featured-tabs.ui-segmented { gap: 22px; }
  .featured-tabs .ui-segmented__item { flex: 0 0 auto; min-width: 0; padding: 0 0 10px; font-size: var(--fs-body); }
  .featured-project-copy { padding: 26px 20px 24px; }
  .featured-project h2 { margin: 12px 0 8px; font-size: var(--fs-title); }
  .featured-project-gallery { min-height: 240px; }
  .featured-project-gallery .featured-project-cover { inset: 18px 64px 40px 18px; }
  .featured-project-gallery figure:not(.featured-project-cover) { width: 78px; height: 104px; border-width: 3px; }
  .featured-project-gallery figure:nth-child(2) { right: 48px; bottom: 16px; }
  .featured-project-gallery figure:nth-child(3) { right: 12px; bottom: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  .featured-project-gallery figure { transition: none; }
}
