/* ==========================================================================
   Ricodisk Enterprise Theme — 31-home-app-case-v2.css
   作用域: home（首页）

   应用范围案例卡片 V2：图片 100% 宽度铺满整屏 + 右侧红色文案面板。

   实现说明：
   - 旧的 01–30 段样式已全部包进 @layer legacy；本文件刻意「不放入任何 layer」。
     本版使用新的单预览 DOM 结构避开旧轮播选择器，无需再用 !important 相互覆盖。
   - 卡片文字（标题/摘要/链接）在后台「页面设置-首页 → 应用范围」逐条配置；
     底图默认 assets/img/home/app-cases/solution-panel-1920x714.png，可逐条上传覆盖。
   ========================================================================== */

/* 图标是页内状态切换按钮，不承担页面跳转。 */
main.psd-home .psd-app-icon {
  border: 0;
  font-family: inherit;
  cursor: pointer;
  appearance: none;
}

/* 英文标签统一预留两行高度，避免长短文案导致图标上下跳动。 */
body.steady-lang-en main.psd-home .psd-app-icon__label {
  height: 2.36em;
  overflow: hidden;
}

body.steady-lang-en main.psd-home .psd-app-icon__label-line {
  display: block;
  overflow: hidden;
  font-size: inherit;
  font-weight: 400;
  line-height: inherit;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* 外层铺满屏幕宽度 */
main.psd-home .psd-app-preview {
  position: relative;
  isolation: isolate;
  width: 100%;
  overflow: hidden;
  background: #b3bfd1;
}

main.psd-home .psd-app-case {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: auto;
  width: 100%;
  color: #fff;
  background: transparent;
  text-decoration: none;
}

main.psd-home .psd-app-case__media {
  position: relative;
  display: block;
  /* 图片 100% 宽度铺满屏幕，不再受 1300px 内容宽度限制 */
  width: 100%;
  /* 高度按设计稿 714/1920 等比随屏宽缩放，下限 320px 保证窄屏可读 */
  height: max(320px, 37.18vw);
  margin: 0;
  overflow: hidden;
  background: #111827;
}

main.psd-home .psd-app-case__media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: var(--app-case-previous-image);
  background-position: center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
}

main.psd-home .psd-app-case__media.is-sliding::before {
  opacity: 1;
  animation: app-case-previous-slide-out .62s cubic-bezier(.22, .61, .36, 1) both;
}

/* 覆盖 legacy 的底部渐变遮罩伪元素（V2 用红色面板承载文案，无需遮罩） */
main.psd-home .psd-app-case::before {
  content: none;
}

main.psd-home .psd-app-case__media > img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  /* 垂直居中裁剪：各背景图主体位置不同时，居中对齐比顶部对齐更均衡 */
  object-fit: cover;
  object-position: center center;
}

main.psd-home .psd-app-case__media > img.is-updating {
  animation: app-case-image-slide-in .62s cubic-bezier(.22, .61, .36, 1) both;
}

@keyframes app-case-image-slide-in {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}

@keyframes app-case-previous-slide-out {
  from { transform: translateX(0); }
  to { transform: translateX(-100%); }
}

/* ── 红色文案面板：几何比例与设计稿一致（x 1153–1552/1920，y 0–578/714，色值 #e50012）── */
main.psd-home .psd-app-case__content {
  position: absolute;
  top: 0;
  left: 60.05%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
  width: 20.83%;
  height: 80.95%;
  /* 内边距用固定 px：百分比 padding 相对卡片宽度解析，会挤压文字宽度 */
  padding: 24px 28px;
  overflow: hidden;
  background: #e50012;
}

main.psd-home .psd-app-case__content.is-updating {
  animation: app-case-content-in 150ms ease-out;
}

@keyframes app-case-content-in {
  from {
    opacity: .75;
    transform: translateX(6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  main.psd-home .psd-app-case__media > img.is-updating,
  main.psd-home .psd-app-case__media.is-sliding::before,
  main.psd-home .psd-app-case__content.is-updating {
    animation: none;
  }
}

/* 面板高度固定，子元素禁止收缩，避免文字区被压没 */
main.psd-home .psd-app-case__content strong,
main.psd-home .psd-app-case__content small,
main.psd-home .psd-app-case__content em,
main.psd-home .psd-app-case__content > span {
  flex-shrink: 0;
}

/* 标题下白色短横线（设计稿元素）：作为面板的 flex 子项排序到标题与摘要之间，
   避免挂在被行截断的标题/摘要内部而被 clamp 吞掉 */
main.psd-home .psd-app-case__content::before {
  content: "";
  display: block;
  flex-shrink: 0;
  order: 2;
  width: 26px;
  height: 4px;
  margin: 12px 0 0;
  background: #fff;
}

main.psd-home .psd-app-case__content strong {
  display: -webkit-box;
  order: 1;
  margin: 0;
  overflow: hidden;
  color: #fff;
  font-size: clamp(20px, 1.8vw, 30px);
  font-weight: 900;
  line-height: 1.24;
  /* 标题最多 3 行（中文约 2 行），与摘要 2 行共同保证面板内容不溢出 */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* 副标题：紧跟案例标题下方（与标题同为 order 1，按 DOM 顺序排在标题后）；
   留空时不渲染占位，避免标题与短横线间出现多余空隙 */
main.psd-home .psd-app-case__content small {
  display: -webkit-box;
  order: 1;
  flex-shrink: 0;
  margin: 8px 0 0;
  overflow: hidden;
  color: rgba(255, 255, 255, .92);
  font-family: "Inter", "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: clamp(13px, 1.1vw, 17px);
  font-weight: 900;
  line-height: 1.8;
  letter-spacing: 0;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

main.psd-home .psd-app-case__content small:empty {
  display: none;
}

/* 摘要：中英文统一默认展示 3 行，超出截断，保证各卡片面板效果一致 */
main.psd-home .psd-app-case__content em {
  display: -webkit-box;
  order: 3;
  margin: 16px 0 24px;
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-style: normal;
  font-weight: 400;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

/* 白框人字形箭头按钮（文字仅作无障碍语义，视觉上替换为箭头图形） */
main.psd-home .psd-app-case__content > span {
  display: inline-flex;
  order: 4;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border: 2px solid #fff;
  font-size: 0;
  line-height: 1;
}

main.psd-home .psd-app-case__content > span::after {
  content: "";
  width: 12px;
  height: 12px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
  transform: rotate(45deg);
}

@media (max-width: 1024px) and (min-width: 426px) {
  main.psd-home .psd-app-case__content {
    /* 针对平板端，调整内边距和最小宽度 */
    padding: 24px 12px;
    min-width: min(185px, 24vw);
  }
}

@media (max-width: 760px) {
  /* 移动端面板加宽为右侧整片，保证文字可读 */
  main.psd-home .psd-app-case__content {
    left: auto;
    right: 0;
    width: 64%;
    height: 100%;
    padding: 20px;
  }

  main.psd-home .psd-app-case__content strong {
    font-size: 18px;
  }

  main.psd-home .psd-app-case__content em {
    margin: 12px 0 16px;
    font-size: 13px;
  }

  main.psd-home .psd-app-case__content > span {
    width: 40px;
    height: 40px;
  }
}

/* ── 移动端重设计准备：PC 端保持首卡联动替换模式 ─────────────────── */
/* 非首张案例卡片默认隐藏（PC 仅首卡可见，内容由 JS 联动替换）；
   只在移动端媒体查询内恢复显示，作为水平滑动的分页 */
main.psd-home .psd-app-preview .psd-app-case:not(:first-of-type) {
  display: none;
}

/* 案例副图为移动端专属元素（设计稿排在副标题与摘要之间），PC 端隐藏 */
main.psd-home .psd-app-case__subimage {
  display: none;
}

/* 圆点指示器仅移动端可见 */
main.psd-home .psd-app-dots {
  display: none;
}

/* ── 移动端「应用范围」重设计（设计稿：案例图/标题/副标题/案例副图/摘要纵向排布，
   隐藏图标导航条，改为案例卡片水平滑动 + 圆点指示器）────────────── */
@media (max-width: 760px) {
  /* 隐藏原有图标水平导航条（含左右箭头） */
  main.psd-home .psd-app-nav {
    display: none;
  }

  /* 预览容器改为水平滑动轨道 */
  main.psd-home .psd-app-preview {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    background: #fff;
    scrollbar-width: none;
  }

  main.psd-home .psd-app-preview::-webkit-scrollbar {
    display: none;
  }

  main.psd-home .psd-app-preview .psd-app-case {
    flex: 0 0 100%;
    width: 100%;
    scroll-snap-align: start;
  }

  /* 恢复显示全部案例卡片（覆盖上方 PC 隐藏规则） */
  main.psd-home .psd-app-preview .psd-app-case:not(:first-of-type) {
    display: block;
  }

  /* 案例图：高度随图片比例，不再固定大屏等比高 */
  main.psd-home .psd-app-case__media {
    height: auto;
    background: transparent;
  }

  main.psd-home .psd-app-case__media > img {
    height: auto;
    /* 16:9 居中裁剪：案例底图为 1920×714 宽幅图，移动端适当裁剪保证视觉重心 */
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  /* 文案区从红色悬浮面板改为图片下方正常流布局（白底深色文字） */
  main.psd-home .psd-app-case__content {
    position: static;
    z-index: auto;
    justify-content: flex-start;
    width: auto;
    height: auto;
    padding: 18px 20px 14px;
    overflow: visible;
    background: transparent;
  }

  /* 红色面板的装饰短横线与箭头按钮不适用于移动端新布局 */
  main.psd-home .psd-app-case__content::before,
  main.psd-home .psd-app-case__content > span {
    display: none;
  }

  /* 案例标题 */
  main.psd-home .psd-app-case__content strong {
    display: block;
    color: var(--color-text);
    font-size: 26px;
    line-height: 1.8;
    text-align: center;
    -webkit-line-clamp: none;
  }

  /* 副标题 */
  main.psd-home .psd-app-case__content small {
    display: block;
    margin: 8px 0 0;
    color: var(--color-muted);
    font-size: 20px;
    font-weight: 600;
    line-height: 1.6;
    text-align: center;
    -webkit-line-clamp: none;
  }

  /* 案例副图：紧跟副标题（与标题/副标题同为 order 1，按 DOM 顺序排列） */
  main.psd-home .psd-app-case__subimage {
    display: none;
    order: 1;
    flex-shrink: 0;
    width: 100%;
    height: auto;
    margin: 16px 0 0;
    border-radius: 12px;
    object-fit: cover;
  }

  /* 案例摘要：完整展示，不再截断 */
  main.psd-home .psd-app-case__content em {
    display: block;
    margin: 16px 0 0;
    color: var(--color-muted);
    font-size: 18px;
    line-height: 1.6;
    -webkit-line-clamp: none;
  }

  /* 圆点指示器 */
  main.psd-home .psd-app-dots {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 18px 0 8px;
  }

  main.psd-home .psd-app-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: 1px solid #9aa3ad;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
  }

  main.psd-home .psd-app-dot.is-active {
    border-color: #e30613;
    background: #e30613;
  }
}
