/* ============================================================
   SwiftIdc Cloud - 展示网站「公告与动态」栏目样式
   列表页 news.html 专用：工具栏 / 新闻卡片 / 分页 / 详情工作台
   复用 assets/style.css 的设计令牌（颜色、圆角、阴影、字体）
   2026-10-31 | r40
   ============================================================ */

/* ---------- 工具栏（分类筛选 + 关键字搜索） ---------- */
.news-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.news-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.news-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--ink-2);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 16px;
  cursor: pointer;
  transition: border-color .18s ease, color .18s ease, background-color .18s ease;
}
.news-cat:hover {
  border-color: var(--brand-soft-line);
  color: var(--brand-strong);
}
.news-cat.is-active {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: var(--brand-soft-line);
  font-weight: 600;
}
.news-cat-count {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--ink-3);
}
.news-cat.is-active .news-cat-count {
  color: var(--brand-strong);
}
.news-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}
.news-search input[type="search"] {
  width: 240px;
  max-width: 100%;
  font-family: inherit;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink);
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 8px 12px;
}
.news-search input[type="search"]:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(11,102,114), .14);
}

/* ---------- 状态行 ---------- */
.news-status {
  margin: 24px 0 0;
  font-size: 14px;
  line-height: 22px;
  color: var(--ink-3);
}
.news-status--error { color: var(--danger); }
.news-status--empty { color: var(--ink-3); }

/* ---------- 列表网格 ---------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.news-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  overflow: hidden;
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.news-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.news-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
  color: inherit;
  text-decoration: none;
}
.news-card-link:hover { text-decoration: none; }

/* 封面：有图用图，无图用品牌渐变占位 */
.news-cover {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(120deg, #084e56 0%, #0e7c86 54%, #0a6670 100%);
  overflow: hidden;
}
.news-cover-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.news-cover--empty::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: 20px 20px;
}

.news-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 18px 20px 20px;
}
.news-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.news-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 2px 10px;
}
.news-chip--top {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-color: var(--brand-soft-line);
}
.news-card-title {
  font-size: 18px;
  line-height: 1.45;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.news-card-summary {
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 出处与作者署名行（对应后台「公告与动态」的 source / author 字段） */
.news-card-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-3);
}
.news-card-byline span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.news-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 13px;
  line-height: 20px;
  color: var(--ink-3);
}

/* ---------- 分页 ---------- */
.news-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 36px;
}
.news-page-info {
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-3);
}

/* ---------- 加载骨架 ---------- */
.news-skeleton {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--canvas);
}
.news-skeleton-cover {
  aspect-ratio: 16 / 9;
  background: var(--canvas-soft);
}
.news-skeleton-body {
  display: grid;
  gap: 12px;
  padding: 20px;
}
.news-skeleton-line {
  height: 12px;
  border-radius: 999px;
  background: var(--canvas-soft);
}
.news-skeleton-line--title { height: 18px; width: 78%; }
.news-skeleton-line--short { width: 46%; }
.news-skeleton .news-skeleton-cover,
.news-skeleton .news-skeleton-line { animation: news-pulse 1.4s ease-in-out infinite; }
@keyframes news-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* ---------- 详情工作台 ---------- */
.news-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  margin-bottom: 24px;
}
.news-back:hover { color: var(--brand-hover); }
.news-article {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  padding: 40px;
}
.news-article-title {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.02em;
  font-weight: 800;
  margin-bottom: 16px;
}
.news-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-3);
}
.news-article-hero {
  margin: 28px 0 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
}
.news-article-hero img {
  display: block;
  width: 100%;
  height: auto;
}
.news-article-summary {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 3px solid var(--brand);
  background: var(--canvas-subtle);
  border-radius: var(--radius-sm);
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-2);
}
.news-article-body {
  margin-top: 24px;
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
}
.news-article-body p { margin-bottom: 16px; }
.news-article-body p:last-child { margin-bottom: 0; }
.news-article-body h2,
.news-article-body h3 {
  font-size: 20px;
  line-height: 1.4;
  font-weight: 700;
  margin: 28px 0 12px;
}
.news-article-body ul,
.news-article-body ol {
  margin: 0 0 16px 20px;
}
.news-article-body li { margin-bottom: 8px; }
.news-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.news-article-body blockquote {
  margin: 16px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--line-strong);
  background: var(--canvas-subtle);
  color: var(--ink-2);
}
.news-article-body a { color: var(--brand); }
.news-article-body .news-demo-note {
  margin-top: 24px;
  font-size: 13px;
  color: var(--ink-3);
}
.news-article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.news-detail-status {
  font-size: 15px;
  line-height: 1.8;
  color: var(--ink-3);
}
.news-detail-status--error { color: var(--danger); }
.news-detail-hint {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-3);
}

/* ---------- 响应式 ---------- */
@media (max-width: 991px) {
  .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .news-search input[type="search"] { width: 200px; }
}
@media (max-width: 767px) {
  .news-toolbar { flex-direction: column; align-items: stretch; }
  .news-search { width: 100%; }
  .news-search input[type="search"] { flex: 1; width: auto; }
  .news-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .news-article { padding: 24px 20px; }
  .news-article-title { font-size: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .news-card { transition: none; }
  .news-skeleton .news-skeleton-cover,
  .news-skeleton .news-skeleton-line { animation: none; }
}

/* ============================================================
   首页「公告与动态」板块（data-sec-key="news"）板块级版式
   卡片与封面图完全复用列表页的 .news-card / .news-cover（封面 16:9 置顶），
   此处只补充首页板块自身的状态行与页脚区排布，不影响 news.html 列表页。
   ============================================================ */

/* 页脚区：查看全部新闻 + 说明文案，统一为一个有间距的纵向区块 */
.home-news-foot {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  margin-top: 32px;
}
.home-news-foot .footnote {
  margin: 0;
}

/* 空态：与卡片同一套圆角 / 边框令牌，占满整行，避免板块折叠成一条文字 */
.news-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 46px 24px;
  text-align: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--canvas-subtle);
}
.news-empty-icon {
  display: inline-flex;
  color: var(--brand);
}
.news-empty-icon .icon {
  width: 30px;
  height: 30px;
}
.news-empty-title {
  font-size: 16px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
}
.news-empty-text {
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

@media (max-width: 767px) {
  .news-empty { padding: 34px 18px; }
  .home-news-foot { margin-top: 26px; }
}

/* ============================================================
   首页「公告与动态」双栏板块（r182）
   左栏官方公告 / 右栏业界动态，每栏各 2 条后台已发布内容；
   左栏用品牌色强调，右栏用蓝色区分，窄屏上下堆叠。
   ============================================================ */
.home-news-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}
.home-news-panel {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--canvas);
  overflow: hidden;
}
.home-news-panel-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--canvas-subtle);
}
.home-news-panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  color: var(--brand-strong);
}
.home-news-panel--industry .home-news-panel-icon {
  background: var(--blue-soft);
  color: var(--blue);
}
.home-news-panel-icon .icon {
  width: 20px;
  height: 20px;
}
.home-news-panel-heading {
  flex: 1;
  min-width: 0;
}
.home-news-panel-title {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--ink);
}
.home-news-panel-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-3);
}
.home-news-panel-more {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  font-size: 13px;
  line-height: 20px;
  font-weight: 600;
  color: var(--brand);
  text-decoration: none;
  white-space: nowrap;
}
.home-news-panel-more:hover {
  color: var(--brand-strong);
  text-decoration: none;
}
.home-news-panel-more .icon {
  width: 14px;
  height: 14px;
}
.home-news-panel-list {
  display: flex;
  flex-direction: column;
  flex: 1;
}
.home-news-item {
  display: flex;
  gap: 14px;
  padding: 18px 22px;
  color: inherit;
  text-decoration: none;
  transition: background-color .18s ease;
}
.home-news-item + .home-news-item {
  border-top: 1px dashed var(--line);
}
.home-news-item:hover {
  background: var(--canvas-subtle);
  text-decoration: none;
}
.home-news-item-thumb {
  flex: none;
  width: 108px;
  height: 76px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: linear-gradient(120deg, #084e56 0%, #0e7c86 54%, #0a6670 100%);
}
.home-news-item-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.home-news-item-thumb--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, .72);
}
.home-news-item-thumb--empty .icon {
  width: 22px;
  height: 22px;
}
.home-news-item-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}
.home-news-item-title {
  font-size: 15px;
  line-height: 1.5;
  font-weight: 600;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-news-item:hover .home-news-item-title {
  color: var(--brand);
}
.home-news-item-summary {
  font-size: 13px;
  line-height: 1.65;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-news-item-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  margin-top: auto;
  font-size: 12px;
  line-height: 18px;
  color: var(--ink-3);
}
.home-news-item-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.home-news-item-top {
  color: var(--brand-strong);
  background: var(--brand-soft);
  border-radius: 999px;
  padding: 0 8px;
  font-weight: 600;
}
.home-news-panel-state {
  flex: 1;
  margin: 0;
  padding: 40px 22px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-3);
}

@media (max-width: 767px) {
  .home-news-panels {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    margin-top: 20px;
  }
  .home-news-panel-head { padding: 16px 18px; }
  .home-news-item { padding: 14px 18px; gap: 12px; }
  .home-news-item-thumb { width: 88px; height: 64px; }
  .home-news-panel-state { padding: 30px 18px; }
}


/* ---- 卡片等高修正（成组卡片拉伸至同高，底部操作区对齐） ---- */
.cs-plan-grid { align-items: stretch; }
.cs-plan-card { height: 100%; }
.cs-plan-card > .cs-plan-foot,
.cs-plan-card > .cs-plan-actions,
.cs-plan-card > .cs-plan-buy { margin-top: auto; }

.news-grid, .news-list { align-items: stretch; }
.news-card { height: 100%; }
.news-card-link { height: 100%; display: flex; flex-direction: column; }
.news-card-body { flex: 1 1 auto; }

.plan-grid { align-items: stretch; }
.plan-card { height: 100%; }


/* ---- 成组卡片跨行等高（文案限行 + 弹性占位） ---- */
.cs-plan-grid, .plan-grid, .news-grid, .news-list, .oa-card-grid, .bm-grid {
  align-items: stretch;
}
.cs-plan-card, .plan-card, .bm-card, .oa-card, .news-card { height: 100%; }
.cs-plan-card .cs-plan-intro {
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; min-height: calc(1.55em * 3);
}
.cs-plan-card .cs-plan-title-row { min-height: 32px; align-items: flex-start; }
.cs-plan-card > .cs-plan-actions,
.cs-plan-card > .cs-plan-price-row { margin-top: auto; }
.news-card-link { height: 100%; display: flex; flex-direction: column; }
.news-card-body { flex: 1 1 auto; }
.news-card .news-card-title {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 575px) {
  .cs-plan-card .cs-plan-intro { -webkit-line-clamp: 4; min-height: calc(1.55em * 4); }
}
