/* ============================================================
   教程列表页（G 风格，作用域 .art-list-page）
   设计稿：docs/preview/ai-images/二级页-G风格/4-教程列表.png
   公共骨架（页头、胶囊、侧栏卡、推广卡、分页、标签）在 page-g.css，这里只写本页独有的块：
   页头搜索框、置顶精选横卡、文章行列表、空结果。文章详情页样式在 page-g-article-detail.css。
   ============================================================ */

/* ── 页头搜索框（白色半透明，蓝底上用） ── */
.art-list-page .art-search {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 560px;
  margin-top: 24px;
}
.art-list-page .art-search label {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  background: #fff;
  color: #9CA3AF;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .14);
}
.art-list-page .art-search input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: 15px;
  color: var(--g-text);
}
.art-list-page .art-search input::placeholder { color: #9CA3AF; }
.art-list-page .art-search label:focus-within { box-shadow: 0 0 0 3px rgba(255, 255, 255, .55), 0 10px 24px rgba(15, 23, 42, .14); }
.art-list-page .art-search button {
  flex-shrink: 0;
  height: 48px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, .7);
  border-radius: 14px;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.art-list-page .art-search button:hover { background: rgba(255, 255, 255, .24); }
.art-list-page .art-search button:focus-visible { outline: 3px solid rgba(255, 255, 255, .7); outline-offset: 2px; }
.art-list-page .art-search-clear {
  flex-shrink: 0;
  font-size: 14px;
  color: rgba(255, 255, 255, .85);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.art-list-page .art-search-clear:hover { color: #fff; }
.art-list-page .art-search + .pg-chips { margin-top: 20px; }

/* ── 置顶精选横卡 ── */
.art-list-page .art-featured {
  padding: 24px;
  border-radius: var(--g-radius);
  background: #fff;
  box-shadow: var(--g-shadow);
}
.art-list-page .art-featured-label { margin-bottom: 16px; }
.art-list-page .art-featured-grid {
  display: grid;
  grid-template-columns: minmax(0, 46%) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
}
.art-list-page .art-featured-cover {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 18px;
  background: var(--g-bg-blue);
}
.art-list-page .art-featured-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.art-list-page .art-featured-body { min-width: 0; }
.art-list-page .art-featured-body h2 {
  margin-top: 14px;
  font-size: clamp(22px, 2.2vw, 28px);
  line-height: 1.4;
  font-weight: 800;
  color: var(--g-title);
}
.art-list-page .art-featured-body h2 a { transition: color .15s; }
.art-list-page .art-featured-body h2 a:hover { color: var(--g-blue-deep); }
.art-list-page .art-featured-body > p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 14px;
  font-size: 16px;
  line-height: 1.8;
  color: var(--g-muted);
}
.art-list-page .art-featured-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
}
.art-list-page .art-featured-foot time { font-size: 15px; color: var(--g-muted); }
.art-list-page .art-featured-foot .pg-link { margin-top: 0; }

/* ── 列表区 ── */
.art-list-page .art-featured-sec { padding-bottom: 0; }
.art-list-page .art-list-sec { padding-top: 56px; }
.art-list-page .art-list-sec.is-after-featured { padding-top: 40px; }
/* 侧栏有分类 + 推广 + 随机三块，比视口高时吸顶会把下半截藏住，本页不吸顶 */
.art-list-page .art-aside { position: static; }

.art-list-page .art-list-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 20px;
}
.art-list-page .art-list-head h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -.01em;
  line-height: 1.3;
  font-weight: 800;
  color: var(--g-title);
}
.art-list-page .art-list-head span { font-size: 15px; color: var(--g-muted); }

.art-list-page .art-rows { display: grid; gap: 16px; }
.art-list-page .art-row {
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--g-shadow-sm);
}
.art-list-page .art-row-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  background: var(--g-bg-blue);
}
.art-list-page .art-row-thumb img { width: 100%; height: 100%; object-fit: cover; }
.art-list-page .art-row-body { min-width: 0; padding-right: 8px; }
.art-list-page .art-row-body h3 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.5;
  font-weight: 700;
  color: var(--g-title);
}
.art-list-page .art-row-body h3 a { transition: color .15s; }
.art-list-page .art-row-body h3 a:hover { color: var(--g-blue-deep); }
.art-list-page .art-row-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.art-list-page .art-row-meta time { font-size: 13px; color: var(--g-muted); }
.art-list-page .art-row-body > p {
  margin-top: 8px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  color: var(--g-muted);
}

/* ── 空结果 ── */
.art-list-page .art-empty {
  padding: 56px 32px;
  border-radius: var(--g-radius);
  background: #fff;
  box-shadow: var(--g-shadow-sm);
  text-align: center;
}
.art-list-page .art-empty .pg-ico { margin: 0 auto 18px; }
.art-list-page .art-empty h2 { font-size: 22px; line-height: 1.4; font-weight: 800; color: var(--g-title); }
.art-list-page .art-empty p { max-width: 460px; margin: 10px auto 0; color: var(--g-muted); }
.art-list-page .art-empty a { color: var(--g-blue-deep); text-decoration: underline; text-underline-offset: 3px; }

.art-list-page .art-side-empty { padding: 8px 0; font-size: 14px; color: var(--g-muted); }
/* 侧栏随机教程的日期：底座 .pg-mini-post time 是 #9CA3AF（白底 2.54:1），本页压到 #6B7280（4.8:1） */
.art-list-page .pg-mini-post time { color: var(--g-muted); }

/* ============================================================
   动效（全站统一参数：悬停 .22s、进场 .6s，缓动 cubic-bezier(.2,.7,.2,1)）
   - 卡片悬停上浮用独立的 translate 属性，不和进场动画用的 transform 打架
   - 进场：列表卡片、侧栏三块带 data-reveal，按兄弟元素错开（延迟由 ui.js 写进 --reveal-delay）
   - 置顶精选卡在首屏、封面是最大内容块，不做进场隐藏，只做悬停
   - 只动 transform / translate / opacity / box-shadow / 颜色，不引起布局偏移
   ============================================================ */
.art-list-page {
  --art-ease: cubic-bezier(.2, .7, .2, 1);
  --art-hover-shadow: 0 16px 40px rgba(37, 99, 235, .12);
}
.art-list-page .art-row,
.art-list-page .art-featured,
.art-list-page .pg-side-card,
.art-list-page .pg-promo {
  transition: translate .22s var(--art-ease), box-shadow .22s var(--art-ease);
}
/* 进场后的过渡：保留 .6s 的淡入位移，同时带上悬停用的过渡（选择器权重高于 page-g.css 的通用规则） */
.js-motion .page-g.art-list-page [data-reveal].is-in {
  transition:
    opacity .6s var(--art-ease) var(--reveal-delay, 0s),
    transform .6s var(--art-ease) var(--reveal-delay, 0s),
    translate .22s var(--art-ease),
    box-shadow .22s var(--art-ease);
}

/* 卡片悬停：上浮 4px + 蓝色淡阴影，封面在圆角容器里放大 1.04 */
.art-list-page .art-row:hover,
.art-list-page .art-featured:hover {
  translate: 0 -4px;
  box-shadow: var(--art-hover-shadow);
}
.art-list-page .art-row-thumb img,
.art-list-page .art-featured-cover img {
  transition: transform .22s var(--art-ease);
}
.art-list-page .art-row:hover .art-row-thumb img,
.art-list-page .art-featured:hover .art-featured-cover img {
  transform: scale(1.04);
}
/* 推广卡里的 3D 图标悬停放大 1.06 */
.art-list-page .pg-promo-art { transition: transform .22s var(--art-ease); }
.art-list-page .pg-promo:hover .pg-promo-art { transform: scale(1.06); }

/* 分类胶囊、分页、搜索按钮：颜色平滑过渡，悬停上浮 1px，按下缩到 .98 */
.art-list-page .pg-chip,
.art-list-page .pg-pager a,
.art-list-page .pg-pager span,
.art-list-page .art-search button {
  transition:
    color .22s var(--art-ease),
    background-color .22s var(--art-ease),
    border-color .22s var(--art-ease),
    box-shadow .22s var(--art-ease),
    transform .22s var(--art-ease);
}
.art-list-page .pg-chip:hover,
.art-list-page .pg-pager a:hover,
.art-list-page .art-search button:hover { transform: translateY(-1px); }
.art-list-page .pg-chip:active,
.art-list-page .pg-pager a:active,
.art-list-page .art-search button:active { transform: scale(.98); }
.art-list-page .pg-pager a:hover { box-shadow: 0 6px 16px rgba(37, 99, 235, .12); }
.art-list-page .pg-side-list a { transition: color .22s var(--art-ease); }

/* 系统设置了「减少动态效果」：悬停位移、缩放全部关掉（进场与过渡已由 page-g.css 关掉） */
@media (prefers-reduced-motion: reduce) {
  .art-list-page .art-row:hover,
  .art-list-page .art-featured:hover { translate: none; }
  .art-list-page .art-row:hover .art-row-thumb img,
  .art-list-page .art-featured:hover .art-featured-cover img,
  .art-list-page .pg-promo:hover .pg-promo-art,
  .art-list-page .pg-chip:hover,
  .art-list-page .pg-chip:active,
  .art-list-page .pg-pager a:hover,
  .art-list-page .pg-pager a:active,
  .art-list-page .art-search button:hover,
  .art-list-page .art-search button:active { transform: none; }
}

/* ── 响应式 ── */
/* 1024 左右宽度：页码 13 个按钮、分类胶囊 5 个都要一行放下 */
@media (max-width: 1100px) {
  .art-list-page .pg-pager,
  .art-list-page .pg-pager .pagination { gap: 6px; }
  .art-list-page .pg-pager a,
  .art-list-page .pg-pager span { min-width: 36px; height: 36px; padding: 0 10px; font-size: 14px; border-radius: 10px; }
  .art-list-page .pg-chips { gap: 8px; }
  .art-list-page .pg-chip { padding: 0 16px; }
}
@media (max-width: 960px) {
  .art-list-page .art-featured-grid { gap: 24px; }
  .art-list-page .art-aside { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
  .art-list-page .art-aside > :last-child { grid-column: 1 / -1; }
}
@media (max-width: 760px) {
  .art-list-page .art-featured-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .art-list-page .art-featured-foot { margin-top: 18px; }
}
@media (max-width: 640px) {
  .art-list-page .art-search { gap: 8px; margin-top: 20px; }
  .art-list-page .art-search label { height: 46px; padding: 0 12px; }
  .art-list-page .art-search input { font-size: 14px; }
  .art-list-page .art-search button { height: 46px; padding: 0 16px; }
  .art-list-page .art-featured { padding: 16px; border-radius: 20px; }
  .art-list-page .art-featured-label { margin-bottom: 12px; }
  .art-list-page .art-featured-body h2 { margin-top: 10px; font-size: 20px; }
  .art-list-page .art-featured-body > p { font-size: 15px; margin-top: 10px; }
  .art-list-page .art-list-sec,
  .art-list-page .art-list-sec.is-after-featured { padding-top: 32px; }
  .art-list-page .art-list-head { flex-direction: column; gap: 4px; margin-bottom: 16px; }
  .art-list-page .art-list-head h2 { font-size: 24px; }
  .art-list-page .art-list-head span { font-size: 13px; }
  .art-list-page .art-rows { gap: 12px; }
  .art-list-page .art-row { grid-template-columns: 112px minmax(0, 1fr); gap: 12px; padding: 10px; border-radius: 16px; }
  .art-list-page .art-row-thumb { border-radius: 10px; }
  .art-list-page .art-row-body { padding-right: 0; }
  .art-list-page .art-row-body h3 { font-size: 15px; }
  .art-list-page .art-row-meta { gap: 8px; margin-top: 6px; }
  .art-list-page .art-row-body > p { display: none; }
  .art-list-page .art-empty { padding: 40px 20px; }
  .art-list-page .art-aside { grid-template-columns: minmax(0, 1fr); }
  /* 本页只有 5 个分类，手机上换行全露出来，比横向滑动更容易发现（底座默认是横向滑动） */
  .art-list-page .pg-chips { flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; gap: 8px; }
}

/* 封面图加载失败时浏览器会画出 alt 文字，裁在封面框内并设透明，不溢出、不露字 */
.art-list-page .art-row-thumb img,
.art-list-page .art-featured-cover img,
.art-list-page .pg-mini-post img {
  overflow: hidden;
  font-size: 12px;
  line-height: 1.4;
  color: transparent;
}

/* 图片骨架屏（A 扫光）：变量、动画、失败占位在 page-g.css 末尾 */
.art-list-page .art-featured-cover img:not(.is-sk-done),
.art-list-page .art-row-thumb img:not(.is-sk-done) {
  background: var(--sk-shine) 150% 0 / 200% 100% no-repeat, var(--sk-icon) center / 32px auto no-repeat, var(--sk-bg);
  animation: sk-shimmer 1.5s linear infinite;
}
.art-list-page .art-featured-cover img:not(.is-sk-done) { background-size: 200% 100%, 48px auto; }
@media (max-width: 640px) {
  /* 手机上列表封面只有一百来像素宽，失败时只放图标，不放会被截成半行的标题 */
  .art-list-page .art-row-thumb .sk-fail { padding: 0; }
  .art-list-page .art-row-thumb .sk-fail span { display: none; }
}
