/* =========================================================
   高上智算 GAOSHANG AI — 资讯模块样式（列表页 + 详情页）

   依赖：
     · css/style.css  变量（--brand-* / --ink-* / --grad-* / --shadow-*）
                      与基础组件（.section / .page-hero / .breadcrumb / .btn）
     · css/trade.css  公共组件（.pager 分页器 / .empty 空状态 / .skeleton 骨架屏）

   命名：列表页 news-*，详情页 article-*
   ========================================================= */

/* =========================================================
   一、列表页 —— 筛选栏
   ========================================================= */
.news-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--ink-100);
}

.news-cats {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.news-cat {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 16px;
  border-radius: var(--r-full);
  border: 1px solid var(--ink-100);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-500);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
.news-cat:hover {
  border-color: var(--brand-300);
  color: var(--brand-600);
}
.news-cat.is-active {
  background: var(--grad-brand);
  border-color: transparent;
  color: #fff;
  box-shadow: var(--shadow-glow);
}
.news-cat__count {
  font-size: 12px;
  font-weight: 500;
  opacity: 0.72;
}

/* 搜索框 */
.news-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 15px;
  border: 1.5px solid var(--ink-100);
  border-radius: var(--r-full);
  background: #fff;
  transition: border-color var(--t-fast) var(--ease),
    box-shadow var(--t-fast) var(--ease);
}
.news-search:focus-within {
  border-color: var(--brand-400);
  box-shadow: 0 0 0 4px var(--brand-50);
}
.news-search svg {
  width: 18px;
  height: 18px;
  color: var(--ink-300);
  flex-shrink: 0;
}
.news-search input {
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14.5px;
  font-family: inherit;
  color: var(--ink-700);
  width: 210px;
  min-width: 0;
}
.news-search input::placeholder { color: var(--ink-300); }

/* 结果提示（搜索/分类生效时显示） */
.news-hint {
  font-size: 13.5px;
  color: var(--ink-400);
  margin-bottom: 20px;
}
.news-hint b { color: var(--brand-600); font-weight: 600; }

/* =========================================================
   二、列表页 —— 资讯条目
   ========================================================= */
.news-list {
  display: grid;
  gap: 16px;
}

.news-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  padding: 26px 28px;
  background: #fff;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-lg);
  text-decoration: none;
  color: inherit;
  overflow: hidden;
  transition: transform var(--t-mid) var(--ease),
    box-shadow var(--t-mid) var(--ease),
    border-color var(--t-mid) var(--ease);
}
/* 有封面图时切成两列 */
.news-item--cover { grid-template-columns: 1fr 240px; }

.news-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grad-brand-soft);
  opacity: 0;
  transition: opacity var(--t-mid) var(--ease);
  pointer-events: none;
}
.news-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: transparent;
}
.news-item:hover::before { opacity: 1; }
.news-item > * { position: relative; z-index: 2; }

.news-item__main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.news-item__tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.news-item__cat {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 12.5px;
  font-weight: 600;
}
.news-item__top {
  display: inline-flex;
  align-items: center;
  padding: 3px 11px;
  border-radius: var(--r-full);
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  color: #fff;
  font-size: 12.5px;
  font-weight: 600;
}

.news-item__title {
  font-size: 19px;
  line-height: 1.5;
  letter-spacing: -0.015em;
  margin-bottom: 10px;
  color: var(--ink-900);
  transition: color var(--t-fast) var(--ease);
  /* 最多两行 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-item:hover .news-item__title { color: var(--brand-600); }

.news-item__summary {
  font-size: 14.5px;
  line-height: 1.8;
  color: var(--ink-500);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.news-item__meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: auto;
  font-size: 13px;
  color: var(--ink-400);
}
.news-item__meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.news-item__meta svg {
  width: 14px;
  height: 14px;
  opacity: 0.75;
}

.news-item__cover {
  width: 100%;
  height: 150px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
}

/* =========================================================
   三、详情页
   ========================================================= */
/* 窄容器：正文阅读宽度（覆盖 .container 的 max-width） */
.container--narrow { max-width: 820px; }

.article-hero {
  position: relative;
  padding: calc(var(--header-h) + 62px) 0 44px;
  background: radial-gradient(900px 460px at 82% -10%, #e7f0ff 0%, transparent 62%),
    radial-gradient(700px 400px at 0% 100%, #e6fbff 0%, transparent 58%),
    var(--ink-50);
  overflow: hidden;
}

.article-hero .breadcrumb {
  justify-content: flex-start;
  margin-bottom: 22px;
}

.article-hero__cat {
  display: inline-flex;
  align-items: center;
  padding: 4px 13px;
  margin-bottom: 16px;
  border-radius: var(--r-full);
  background: var(--brand-50);
  color: var(--brand-600);
  font-size: 13px;
  font-weight: 600;
}

.article-hero__title {
  font-size: clamp(26px, 3.6vw, 40px);
  line-height: 1.35;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
  color: var(--ink-900);
}

.article-hero__meta {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 13.5px;
  color: var(--ink-400);
}
.article-hero__meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.article-hero__meta svg { width: 15px; height: 15px; opacity: 0.75; }

/* 正文排版 */
.article {
  font-size: 16.5px;
  line-height: 1.95;
  color: var(--ink-700);
}
.article p { margin-bottom: 22px; }
.article p:last-child { margin-bottom: 0; }

.article h2 {
  font-size: 23px;
  line-height: 1.5;
  margin: 40px 0 18px;
  color: var(--ink-900);
  letter-spacing: -0.02em;
}
.article h3 {
  font-size: 19px;
  line-height: 1.5;
  margin: 32px 0 14px;
  color: var(--ink-900);
}

/* 列表项（以「- 」「1. 」开头时由 JS 包成 ul/ol） */
.article ul,
.article ol {
  margin: 0 0 22px 22px;
  padding: 0;
}
.article li {
  margin-bottom: 10px;
  padding-left: 4px;
}
.article li::marker { color: var(--brand-500); }

.article strong { color: var(--ink-900); font-weight: 700; }

.article blockquote {
  margin: 24px 0;
  padding: 16px 22px;
  border-left: 3px solid var(--brand-400);
  background: var(--ink-50);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--ink-500);
  font-size: 15.5px;
}

/* 转载来源 */
.article-source {
  margin-top: 34px;
  padding: 14px 18px;
  background: var(--ink-50);
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  font-size: 13.5px;
  color: var(--ink-400);
}
.article-source a {
  color: var(--brand-600);
  word-break: break-all;
}
.article-source a:hover { text-decoration: underline; }

/* 上一篇 / 下一篇 */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 44px;
  padding-top: 34px;
  border-top: 1px solid var(--ink-100);
}
.article-nav__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 20px;
  border: 1px solid var(--ink-100);
  border-radius: var(--r-md);
  text-decoration: none;
  transition: border-color var(--t-fast) var(--ease),
    background var(--t-fast) var(--ease);
}
.article-nav__item:hover {
  border-color: var(--brand-300);
  background: var(--brand-50);
}
.article-nav__item--next { text-align: right; }
.article-nav__label {
  font-size: 12.5px;
  color: var(--ink-400);
}
.article-nav__title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink-700);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-nav__item:hover .article-nav__title { color: var(--brand-600); }

/* 底部转化条 */
.article-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  flex-wrap: wrap;
  margin-top: 40px;
  padding: 28px 32px;
  border-radius: var(--r-lg);
  background: var(--grad-brand-soft);
  border: 1px solid var(--ink-100);
}
.article-cta h3 {
  font-size: 19px;
  margin-bottom: 6px;
  color: var(--ink-900);
}
.article-cta p {
  font-size: 14.5px;
  color: var(--ink-500);
  line-height: 1.7;
}

.article-back {
  margin-top: 30px;
  font-size: 14px;
}
.article-back a { color: var(--brand-600); font-weight: 600; }
.article-back a:hover { text-decoration: underline; }

/* 详情页骨架屏：与最终排版高度接近，避免加载时跳动 */
.article-skeleton .skel-h { height: 26px; width: 62%; margin-bottom: 20px; }
.article-skeleton .skel-w { height: 15px; margin-bottom: 12px; }
.article-skeleton .skel-w:nth-child(3) { width: 92%; }
.article-skeleton .skel-w:nth-child(4) { width: 78%; }

/* =========================================================
   四、响应式
   ========================================================= */
@media (max-width: 900px) {
  .news-item--cover { grid-template-columns: 1fr 190px; }
  .news-item { padding: 22px 22px; }
}

@media (max-width: 720px) {
  /* 移动端封面图移到上方、文字在下 */
  .news-item--cover { grid-template-columns: 1fr; }
  .news-item--cover .news-item__cover {
    order: -1;
    height: 170px;
  }
  .news-item__title { font-size: 17.5px; }

  .news-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .news-search input { width: 100%; }
  .news-search { width: 100%; }

  .article-nav { grid-template-columns: 1fr; }
  .article-nav__item--next { text-align: left; }

  .article-cta {
    flex-direction: column;
    align-items: flex-start;
    padding: 24px;
  }
}
