/**
 * 悠推 2.0 平台资讯列表页样式
 * 2026-10-19 设计稿还原：平台咨询列表页 (21811:2220) / 咨询详情页 (21815:15538)
 * 复用全站设计变量与 .news-* 视觉语言 (首页资讯模块同源)
 */

/* ==========================================================================
   Hero 区（设计稿：渐变背景 + 两行大标题 + 副文案 + 右侧插画）
   ========================================================================== */
/* 列表页/详情页底部设计稿为纯白（无全站渐变），覆盖共用包裹区的浅灰渐变 */
.news-detail-page .bottom-gradient-wrap,
.news-list-page .bottom-gradient-wrap {
  background: #ffffff;
}

/* PC 端正文最小高度：空白放在正文内容区内部（相关文章紧随正文），值取 240px 保证短正文时页脚/相关文章位置合理且整页不产生滚动条 */
@media (min-width: 769px) {
  .news-detail-content {
    min-height: 240px;
  }
}

.news-hero-section {
  background: linear-gradient(180deg, #f4f4f6 0%, #ffffff 100%);
}

.news-hero-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* padding: 40px 0 64px; */
  padding-top: 20px;
  padding-bottom: 64px;
  gap: 40px;
}

.news-hero-copy {
  text-align: left;
}

.news-hero-title {
  font-size: 56px;
  font-weight: 700;
  color: #111111;
  line-height: 72px;
  letter-spacing: 0;
  margin: 0;
}

.news-hero-desc {
  font-size: 16px;
  color: #444444;
  margin-top: 16px;
  line-height: 32px;
}

.news-hero-visual {
  width: 352px;
  height: 352px;
  object-fit: contain;
  filter: drop-shadow(0 12px 32px rgba(236, 139, 139, 0.25));
}

/* PC 只校准左侧文字顶边，保持右侧插画位置不变。 */
@media (min-width: 1200px) {
  .news-hero-title {
    font-size: 48px;
  }

  .news-hero-copy {
    transform: translateY(8px);
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .news-hero-title {
    font-size: 48px;
    line-height: 1.25;
  }

  .news-hero-copy {
    transform: translateY(calc(13vw - 168.5px));
  }
}

/* ==========================================================================
   资讯卡片列表
   ========================================================================== */
.news-list-section {
  padding: 30px 0 80px;
  background: #ffffff;
}

.news-cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  row-gap: 40px;
}

.news-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  overflow: hidden;
  min-height: 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
  transition: border-color var(--transition-fast);
}

.news-card:hover {
  border-color: rgba(255, 59, 48, 0.3);
}

.news-card:focus-visible {
  outline: 2px solid rgba(255, 59, 48, 0.35);
  outline-offset: 2px;
}

/* 卡片封面：贴边通栏（设计稿 393×180 比例裁切） */
.news-card-cover {
  display: block;
  aspect-ratio: 393 / 180;
  overflow: hidden;
  background: #f5f5f5;
}

.news-card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
  will-change: transform;
}

/* 悬浮时封面微放大（卡片整体同时上浮），过渡动画遵循全站时长/缓动与无障碍降级 */
.news-card:hover .news-card-cover img,
.news-card:focus-within .news-card-cover img {
  transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
  .news-card-cover img,
  .news-card {
    transition: none;
  }
}

.news-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #181c29;
  line-height: 1.5;
  margin: 16px 20px 0;
  /* 标题单行省略（与首页资讯条目一致） */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--transition-fast);
}

.news-card:hover .news-card-title {
  color: #ff3b30;
}

.news-card-summary {
  font-size: 14px;
  color: #444444;
  line-height: 20px;
  margin: 8px 20px 0;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 16px 20px;
  border-top: none;
}

.news-card-date {
  font-size: 12px;
  color: #666666;
  line-height: 20px;
}

.news-card-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 500;
  color: #666666;
  line-height: 20px;
  transition: color var(--transition-fast);
}

.news-card-more svg {
  transition: transform var(--transition-fast);
}

.news-card:hover .news-card-more {
  color: #ff3b30;
}

.news-card:hover .news-card-more svg {
  transform: translate(2px, -2px);
}

/* ==========================================================================
   列表页状态 (加载中 / 空态 / 失败提示)
   ========================================================================== */
.news-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 64px 0;
  color: var(--color-text-muted);
  font-size: 14px;
}

.news-state .news-state-text {
  vertical-align: middle;
}

/* 列表加载骨架屏：占位卡片与真实卡片同构（封面 + 标题两行 + 摘要两行 + 底栏） */
.news-card-skeleton {
  pointer-events: none;
}

.skeleton-block,
.skeleton-line {
  background: linear-gradient(90deg, #f0f0f2 25%, #e6e6ea 37%, #f0f0f2 63%);
  background-size: 400% 100%;
  animation: newsSkeletonShimmer 1.4s ease infinite;
  border-radius: 4px;
}

/* 封面块自带 aspect-ratio，直接复用 .news-card-cover 的尺寸，渐变由 .skeleton-block 提供 */
.news-card-skeleton .skeleton-block {
  border-radius: 0;
}

.skeleton-line {
  height: 14px;
  margin: 16px 20px 0;
}

/* 高度对齐真实卡片单行标题 18px/1.5 = 27px */
.skeleton-line-title {
  height: 27px;
}

/* 摘要两行与真实卡片一致：行高 20px，行间无缝 */
.skeleton-line-summary {
  height: 20px;
  margin-top: 8px;
}

.skeleton-line-summary-short {
  width: 80%;
  margin-top: 0;
}

.skeleton-line-date {
  width: 72px;
  height: 14px;
  margin: 0;
}

.skeleton-line-more {
  width: 56px;
  height: 14px;
  margin: 0;
}

@keyframes newsSkeletonShimmer {
  from {
    background-position: 100% 50%;
  }

  to {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .skeleton-block,
  .skeleton-line {
    animation: none;
    background: #f0f0f2;
  }
}

/* ==========================================================================
   分页条（设计稿：32×32 方钮、chevron 图标、当前页红底、hover 浅红描边）
   ========================================================================== */
.news-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.news-page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(0, 0, 0, 0.07);
  border-radius: 3px;
  background: #ffffff;
  color: #111111;
  font-size: 14px;
  font-weight: 400;
  line-height: 22px;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.news-page-btn:hover:not(:disabled) {
  border-color: rgba(255, 36, 66, 0.1);
  color: #ff3b30;
}

.news-page-btn.is-current {
  background: #ff3b30;
  border-color: #ff3b30;
  color: #f6f6f6;
  cursor: default;
}

.news-page-btn:disabled {
  color: #c2c2c2;
  border-color: rgba(0, 0, 0, 0.07);
  cursor: not-allowed;
}

.news-page-ellipsis {
  color: #999999;
  padding: 0 4px;
  font-size: 14px;
}

/* ==========================================================================
   响应式断点
   ========================================================================== */
@media (max-width: 991px) {
  .news-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .news-hero-title {
    font-size: 44px;
    line-height: 58px;
  }
}

@media (max-width: 767.98px) {
  .news-hero-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 16px 16px 0px;
    gap: 24px;
  }

  .news-hero-copy {
    text-align: center;
  }

  .news-hero-title {
    font-size: 32px;
    line-height: 44px;
  }

  .news-hero-desc {
    font-size: 14px;
    line-height: 24px;
    margin-top: 8px;
  }

  .news-hero-visual {
    width: 220px;
    height: 220px;
  }

  .news-list-section {
    padding: 24px 0 60px;
    padding-top: 0;
  }

  .news-cards-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    row-gap: 16px;
  }

  .news-card-cover {
    aspect-ratio: 343 / 150;
  }

  .news-card-title {
    font-size: 14px;
    line-height: 1.5;
    margin: 14px 16px 0;
  }

  .news-card-summary {
    font-size: 12px;
    line-height: 17px;
    margin: 6px 16px 0;
  }

  .news-card-footer {
    margin-top: 14px;
    padding: 14px 16px;
  }

  .news-pagination {
    gap: 6px;
    margin-top: 32px;
  }

  .news-page-btn {
    width: 30px;
    height: 30px;
    font-size: 13px;
  }

  .skeleton-line {
    margin-left: 16px;
    margin-right: 16px;
  }

  .skeleton-line-title {
    height: 21px;
    margin-top: 14px;
  }

  .skeleton-line-summary {
    margin-top: 8px;
  }

  .skeleton-line-date,
  .skeleton-line-more {
    margin: 0;
  }
}

/* ==========================================================================
   资讯详情页（设计稿：面包屑 + 标题/分隔线/发布时间 + 正文 + 相关文章灰底卡）
   ========================================================================== */
.news-detail-section {
  padding: 16px 0 96px;
  background: #ffffff;
}

.news-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 820px;
  margin: 0 auto 24px;
  font-size: 14px;
  color: #111111;
}

.news-breadcrumb a {
  color: #888888;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.news-breadcrumb a:hover {
  color: #ff3b30;
}

.news-breadcrumb-chevron {
  display: block;
  color: #888888;
}

.news-detail {
  max-width: 820px;
  margin: 0 auto;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.news-detail-title {
  font-size: 32px;
  font-weight: 700;
  color: #111111;
  line-height: 1.4;
  margin: 0;
}

.news-detail-meta {
  margin-top: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f6f6f6;
}

.news-detail-date {
  font-size: 12px;
  color: #888888;
}

/* 正文为后台维护的富文本，按设计稿 14/20 排版约束 */
.news-detail-content {
  margin-top: 20px;
  font-size: 14px;
  color: #444444;
  line-height: 20px;
  word-break: break-word;
}

.news-detail-content img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.news-detail-content h1,
.news-detail-content h2,
.news-detail-content h3 {
  color: #444444;
  font-size: 16px;
  font-weight: 700;
  line-height: 24px;
  margin: 20px 0 12px;
}

.news-detail-content p {
  margin: 0 0 20px;
}

.news-detail-content ul,
.news-detail-content ol {
  padding-left: 22px;
  margin: 0 0 20px;
}

.news-detail-content a {
  color: var(--color-primary);
}

.news-detail-content blockquote {
  margin: 0 0 20px;
  padding: 10px 16px;
  border-left: 3px solid var(--color-primary);
  background: #fafafa;
  color: var(--color-text-muted);
}

/* 相关文章灰底卡（设计稿：桌面正文与卡间距 60；移动端 21815:22254 先分隔线再 32px 到标题；「相关文章」标题仅移动端显示） */
.news-related-block {
  max-width: 820px;
  margin: 60px auto 0;
}
.news-related-heading {
  display: none;
  margin: 0 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: #111111;
}

.news-detail-related {
  display: flex;
  gap: 16px;
  background: #f4f4f6;
  border-radius: 12px;
  padding: 24px 32px;
}

.news-related-item {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex: 1;
  min-width: 0;
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.news-related-item + .news-related-item {
  border-left: 1px solid #c2c2c2;
  padding-left: 32px;
}

.news-related-item:hover .news-related-title {
  color: #ff3b30;
}

.news-related-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 16px;
  color: #666666;
}

.news-related-title {
  font-size: 15px;
  color: #111111;
  line-height: 18px;
  transition: color var(--transition-fast);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-detail-state {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 15px;
  padding: 48px 0;
  margin: 0;
}

.news-detail-missing {
  text-align: center;
  padding: 24px 0;
}

.news-detail-back-btn {
  display: inline-block;
  margin-top: 8px;
  padding: 10px 24px;
  border-radius: 999px;
  background: var(--color-primary);
  color: #ffffff;
  font-size: 14px;
  text-decoration: none;
  transition: background 0.2s ease;
}

.news-detail-back-btn:hover {
  background: var(--color-primary-hover);
}

@media (max-width: 768px) {
  .news-detail-section {
    padding: 16px 0 16px;
  }

  .news-breadcrumb {
    margin-bottom: 16px;
  }

  .news-detail-title {
    font-size: 20px;
    font-weight: 500;
    line-height: 32px;
  }

  .news-detail-meta {
    margin-top: 9px;
    padding-bottom: 9px;
  }

  .news-detail-content {
    margin-top: 15px;
  }

  .news-detail-content p {
    margin: 0 0 15px;
  }

  .news-detail-related {
    flex-direction: column;
    gap: 20px;
    margin-top: 0;
    padding: 16px 14px;
  }

  .news-related-block {
    max-width: none;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid #f6f6f6;
  }

  .news-related-heading {
    display: block;
  }

  .news-detail-date {
    font-weight: 500;
    line-height: 24px;
  }

  .news-related-item {
    gap: 0;
  }

  .news-related-item + .news-related-item {
    border-left: none;
    padding-left: 0;
    border-top: none;
    padding-top: 0;
  }

  .news-related-label {
    display: none;
  }

  .news-related-title {
    font-size: 14px;
    color: #444444;
  }

  .news-related-title::before {
    content: attr(data-dir-prefix);
  }
}
