/*
 * subpage.css · 二级页面样式（/cases 客户案例、/cases/[id] 案例详情、/faq 常见问题、
 *                              /articles 公司资讯、/articles/[slug] 资讯详情）
 * Page: Cases（客户案例）/ Case Detail（案例详情）/ FAQ（常见问题）/
 *       Articles（公司资讯）/ Article Detail（资讯详情）
 * Purpose: 让二级页面沿用首页设计稿（design/code.html → home.css）的设计令牌与
 *          .hp-* 组件语言，仅补充首页没有的「子页专属结构」：
 *          面包屑 Hero、案例库行业切换、案例详情正文、FAQ 分类分组与右侧 sticky 咨询卡、
 *          资讯列表行与分页器、资讯详情正文卡。
 *          作用域 .sub-page，令牌与 .hp-* 组件由 home.css 提供（两者必须同时加载，
 *          且本文件必须排在 home.css 之后 —— home.css 的基础重置
 *          `.sub-page :where(h1…figure){margin:0;padding:0}` 特异度为 (0,1,0)，
 *          与本文件的 .sp-* 单类规则同级，先加载会被重置反压、间距静默归零）。
 * Future Components: CasesListPage.vue / CaseDetailPage.vue / SubPageHero.vue /
 *                    CaseIndustryTabs.vue / CaseCard.vue / CaseIntroBlock.vue /
 *                    CaseProcessGallery.vue / CaseReviewBlock.vue / CaseReviewShot.vue /
 *                    FaqListPage.vue / FaqAccordionItem.vue / FaqAsideCard.vue /
 *                    ArticleListPage.vue / ArticleRow.vue / ArticlePagination.vue /
 *                    ArticleDetailPage.vue / ArticleDetailBody.vue
 * Possible APIs: GET /cases?where[status][equals]=active, GET /cases/{id},
 *                GET /faqs?where[status][equals]=published,
 *                GET /articles?page=1&limit=10, GET /articles/{externalId},
 *                GET /globals/cases-module, GET /globals/faq-module,
 *                GET /globals/news-module, GET /globals/site-settings
 *
 * 命名前缀统一 sp-*（sub page），与 hp-*（home page）区分：
 *   · hp-* —— 首页与二级页共用的既有组件（区块、卡片、Tab、手风琴、按钮）
 *   · sp-* —— 仅二级页存在的结构（Hero 面包屑、案例工具条、案例详情正文、FAQ 侧栏、
 *             资讯列表行、资讯分页器、资讯详情正文卡）
 * 间距沿用设计规范的 8 / 12 / 16 / 20 / 24 / 32；字号沿用 12 / 14 / 16 三档，
 * 大于 16px 的标题取 30 / 36。断点沿用 640 / 768 / 1024。
 */

/* ========== 子页 Hero · 面包屑 + 标题 + 描述 ========== */
.sp-hero {
  padding: 32px 0 40px;
  border-bottom: 1px solid var(--hp-slate-100);
  background: linear-gradient(
    to bottom,
    rgb(255 247 237 / 0.4) 0%,
    #fff 45%,
    rgb(255 255 255 / 0) 100%
  );
}

/* 面包屑 · 12px 档元信息层 */
.sp-crumb {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--hp-slate-500);
}

.sp-crumb a { transition: color 0.2s; }
.sp-crumb a:hover { color: var(--hp-brand); }

.sp-crumb__sep { color: var(--hp-slate-300); }

.sp-crumb__current { color: var(--hp-slate-700); font-weight: 600; }

/* 眉标复用 .hp-eyebrow，子页为左对齐 */
.sp-hero .hp-eyebrow {
  margin-top: 16px;
  justify-content: flex-start;
}

/* 页面主标题 h1 · 与首页 .hp-title 同族，仅放大到 30 / 36 档 */
.sp-title {
  margin-top: 8px;
  font-family: var(--hp-font-display);
  font-size: 30px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--hp-slate-900);
}

/* 页面描述 · 复用 .hp-desc（14px/1.6 slate-600），限定行长 */
.sp-hero__desc {
  max-width: 672px;
}

/* ========== /cases · 行业切换工具条 ========== */
/* Tab 容器复用 .hp-tabs（无 .industry-tabs 药丸外框），子页左对齐 */
.sp-case-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.sp-case-toolbar .hp-tabs { margin-bottom: 0; justify-content: flex-start; }

/* 当前分组案例总数 · 12px mono 辅助信息 */
.sp-case-count {
  font-family: var(--hp-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hp-slate-400);
}

/* 分组标题右侧条数（复用 .hp-case-group__title 的 16px 档） */
.sp-case-group__count {
  font-family: var(--hp-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--hp-slate-400);
}

/* 空态 · 该行业暂无已发布案例 */
.sp-empty {
  padding: 32px 16px;
  border: 1px dashed var(--hp-slate-200);
  border-radius: var(--hp-radius-xl);
  background: #fff;
  font-size: 12px;
  line-height: 1.6;
  color: var(--hp-slate-500);
  text-align: center;
}

/* ========== /faq · 问答平铺列表 + 右侧咨询卡 ========== */
.sp-faq__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

/* 手风琴列表 · 复用 .hp-faq__list / .hp-faq-item（原生 details，无需 JS）
   问题按后台 sortOrder 平铺，前端不再按 category 分组 */

/* 右侧咨询卡 · 桌面端 sticky 常驻 */
.sp-faq__aside { position: relative; }

.sp-faq__card {
  padding: 20px;
  border: 1px solid rgb(226 232 240 / 0.8);
  border-radius: var(--hp-radius-xl);
  background: #fff;
  box-shadow: var(--hp-shadow-sm);
}

.sp-faq__card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--hp-slate-900);
}

.sp-faq__card-desc {
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--hp-slate-500);
}

/* 联系方式行 · 与首页 .hp-audit__rows 同规格（8px 间距、12px 文字） */
.sp-faq__rows {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hp-slate-100);
}

.sp-faq__rows > * + * { margin-top: 8px; }

.sp-faq__row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--hp-slate-600);
}

.sp-faq__row-icon {
  flex: none;
  margin-top: 1px;
  font-size: 16px;
  color: var(--hp-brand);
}

.sp-faq__row strong { font-weight: 700; color: var(--hp-slate-900); }
.sp-faq__row a { transition: color 0.2s; }
.sp-faq__row a:hover { color: var(--hp-brand); }

/* 主 CTA · 复用 .hp-btn--primary，子页侧栏内通栏展示 */
.sp-faq__actions { margin-top: 16px; }
.sp-faq__actions .hp-btn { width: 100%; }

/* 热门问题锚点列表 */
.sp-faq__hot {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--hp-slate-100);
}

.sp-faq__hot-title {
  font-family: var(--hp-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hp-slate-400);
}

.sp-faq__hot-list { margin-top: 8px; }
.sp-faq__hot-list > * + * { margin-top: 8px; }

.sp-faq__hot-link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--hp-slate-600);
  transition: color 0.2s;
}

.sp-faq__hot-link:hover { color: var(--hp-brand); }

.sp-faq__hot-index {
  flex: none;
  font-family: var(--hp-font-mono);
  font-weight: 700;
  color: var(--hp-brand);
}

/* ========== /cases/[id] · 案例详情正文 ========== */
/* 正文块（项目简介 / 用户评价）· 标题规格与 .hp-case-group__title 一致 */
.sp-case-block + .sp-case-block { margin-top: 32px; }

.sp-case-block__title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--hp-slate-900);
}

.sp-case-block__title .hp-dot {
  width: 6px;
  height: 6px;
}

/* 项目简介 · 后台 textarea，pre-line 保留运营填写的换行 */
.sp-case-block__text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--hp-slate-600);
  white-space: pre-line;
}

/* 项目过程图 · 后台 array 字段，0～3 张；未上传时前端不输出该容器
 * 列数由 --1 / --2 / --3 修饰类决定（1 张通栏，2～3 张在 640px 起等分）
 * 卡片外观（1px 描边 + --hp-radius-xl + --hp-shadow-sm）与 .sp-case-quote 统一 */
.sp-case-process {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.sp-case-process__img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid rgb(226 232 240 / 0.8);
  border-radius: var(--hp-radius-xl);
  background: #fff;
  box-shadow: var(--hp-shadow-sm);
}

/* 用户评价 · 左侧品牌橙引导线的引文卡
 * 用 div 而非 blockquote：基础重置的 :where() 列表未含 blockquote，
 * 直接用语义标签会带上浏览器默认的 1em 40px 外边距。 */
.sp-case-quote {
  padding: 20px;
  border: 1px solid rgb(226 232 240 / 0.8);
  border-left: 3px solid var(--hp-brand);
  border-radius: var(--hp-radius-xl);
  background: #fff;
  box-shadow: var(--hp-shadow-sm);
}

.sp-case-quote__text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--hp-slate-700);
  white-space: pre-line;
}

.sp-case-quote__by {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--hp-slate-500);
}

/* 评价截图 · 后台 upload 字段，0～1 张；未上传时前端不输出该 figure
 * 白卡承托原始凭证，外观与 .sp-case-quote 一致（去掉左侧橙色引导线以区分层级）
 * 限高 480px + contain：长截图等比缩放并水平居中，不裁切内容 */
.sp-case-shot {
  margin-top: 16px;
  padding: 12px;
  border: 1px solid rgb(226 232 240 / 0.8);
  border-radius: var(--hp-radius-xl);
  background: #fff;
  box-shadow: var(--hp-shadow-sm);
}

.sp-case-shot__img {
  max-height: 480px;
  margin: 0 auto;
  border-radius: var(--hp-radius-lg);
  object-fit: contain;
}

/* 返回上一级列表 · 文本按钮行（案例详情 / 资讯详情共用同一规格） */
.sp-case-back,
.sp-article-back {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--hp-slate-100);
}

/* ========== /articles · 资讯列表 ========== */
/* 工具条 · 与 /cases 的 .sp-case-toolbar 同规格（左标题 / 右统计） */
.sp-news-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

/* 列表标题 · 规格与 .hp-case-group__title 一致（16px/700 + 品牌橙圆点） */
.sp-news-toolbar__title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.01em;
  color: var(--hp-slate-900);
}

.sp-news-toolbar__title .hp-dot {
  width: 6px;
  height: 6px;
}

/* 已发布资讯总数 · 12px mono 辅助信息（同 .sp-case-count） */
.sp-news-count {
  font-family: var(--hp-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hp-slate-400);
}

/* 资讯行列表 · 间距沿用 FAQ 列表的 12px */
.sp-news__list > * + * { margin-top: 12px; }

/* 单条资讯行 · 白卡（外观与 .hp-faq-item / .hp-case-card 统一）
 * 整行不做 <a> 包裹：标题与「阅读全文」各自成链，避免嵌套 a 标签 */
.sp-news-row {
  padding: 20px;
  border: 1px solid rgb(226 232 240 / 0.8);
  border-radius: var(--hp-radius-xl);
  background: #fff;
  transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.2s;
}

/* hover 规格与 home.css「卡片 hover 浮动统一层」一致（上浮 4px + --hp-shadow-lift）；
   本文件后于 home.css 加载，故 sp-* 卡片的 hover 态就地声明，避免被此处覆盖 */
.sp-news-row:hover {
  transform: translateY(-4px);
  box-shadow: var(--hp-shadow-lift);
}

/* 发布日期 · 12px mono 元信息层（同 .hp-news-card__meta） */
.sp-news-row__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-family: var(--hp-font-mono);
  font-size: 12px;
  color: var(--hp-slate-400);
}

.sp-news-row__date { white-space: nowrap; }

/* 标题 · 16px 档（子区块标题），最多 2 行截断 */
.sp-news-row__title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -0.01em;
  color: var(--hp-slate-900);
}

.sp-news-row__title a { transition: color 0.2s; }
.sp-news-row__title a:hover { color: var(--hp-brand); }

/* 摘要 · 12px/1.7，最多 2 行截断 */
.sp-news-row__excerpt {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  margin-top: 8px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--hp-slate-500);
}

/* 卡脚 · 阅读全文（规格同 .hp-news-card__foot / __more） */
.sp-news-row__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid rgb(226 232 240 / 0.8);
  font-size: 12px;
}

.sp-news-row__more {
  font-weight: 600;
  color: var(--hp-brand);
}

.sp-news-row__more:hover { text-decoration: underline; }

/* 分页器 · 32px 方形按钮（尺寸沿用 .hp-btn--sm 的 8px 纵向内距） */
.sp-news-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 32px;
}

.sp-news-pager__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--hp-slate-200);
  border-radius: var(--hp-radius-lg);
  background: #fff;
  font-family: var(--hp-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--hp-slate-700);
  white-space: nowrap;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.sp-news-pager__btn:hover:not(.is-active):not(.is-disabled) {
  border-color: var(--hp-brand-200);
  background: var(--hp-brand-50);
  color: var(--hp-brand);
}

.sp-news-pager__btn.is-active {
  border-color: var(--hp-brand);
  background: var(--hp-brand);
  color: #fff;
}

.sp-news-pager__btn.is-disabled {
  border-color: var(--hp-slate-100);
  background: var(--hp-slate-50);
  color: var(--hp-slate-300);
  cursor: not-allowed;
}

/* 省略号与「共 N 篇 · 第 X / Y 页」辅助信息 */
.sp-news-pager__info {
  font-family: var(--hp-font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hp-slate-400);
}

/* ========== /articles/[slug] · 资讯详情正文 ========== */
/* 正文白卡 · 外观与 .sp-case-quote / .hp-faq-item 统一 */
.sp-article__body {
  padding: 20px;
  border: 1px solid rgb(226 232 240 / 0.8);
  border-radius: var(--hp-radius-xl);
  background: #fff;
  box-shadow: var(--hp-shadow-sm);
}

/* 富文本排版沿用 site.css 的 .article-detail__content（h2/h3/p/ul/table/code…），
   此处仅收敛卡内首尾元素的默认外边距（特异度 0,2,0 高于 site.css 的 0,1,1） */
.sp-article__body > :first-child { margin-top: 0; }
.sp-article__body > :last-child { margin-bottom: 0; }

/* ========== 响应式 · 断点沿用 640 / 768 / 1024 ========== */
@media (min-width: 640px) {
  .sp-hero { padding: 40px 0 48px; }

  /* 项目过程图 2～3 张时等分排布，1 张保持通栏 */
  .sp-case-process--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-case-process--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* 资讯详情正文卡 · 桌面端起放宽内距 */
  .sp-article__body { padding: 32px; }
}

@media (min-width: 1024px) {
  .sp-title { font-size: 36px; }

  .sp-faq__layout {
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
  }

  /* 吸顶偏移 = 站点页头高度（sticky top:0）+ 24px 视觉间距 */
  .sp-faq__aside {
    position: sticky;
    top: 96px;
  }
}

/* ==========================================================================
   卡片 hover 浮动统一层（二级页）
   --------------------------------------------------------------------------
   与 home.css 的同名层同规格：上浮 4px + --hp-shadow-lift。
   .sp-news-row 的 hover 已在其基础规则处就地声明（本文件后于 home.css 加载，
   同特异度下靠后胜出，集中写在此处会被反向覆盖）。
   不参与本层：
   - .sp-article__body：资讯正文长容器，上浮会在阅读时产生位移抖动
   - .sp-case-process__img：项目过程图，属图片而非卡片
   ========================================================================== */

.sp-faq__card,
.sp-case-quote,
.sp-case-shot {
  transition:
    transform 0.24s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.24s cubic-bezier(0.4, 0, 0.2, 1);
}

.sp-faq__card:hover,
.sp-case-quote:hover,
.sp-case-shot:hover {
  transform: translateY(-4px);
  box-shadow: var(--hp-shadow-lift);
}
