/* ============================================================
   news.css — 新闻动态体系（/news 列表页 /news/{id} 详情页）
   依赖 style.css 基础令牌与 about.css 工具类（ab-hero/ab-cta/ab-empty）
   文字层：浅区 --t-strong/--t-h3，次级 --ink-2/--ink-3（暗色末尾重映射）
   ============================================================ */

/* ---- Hero 统计 ---- */
.nw-stats { display: flex; align-items: center; gap: 22px; margin-top: 26px; }
.nw-stat { display: flex; align-items: baseline; gap: 7px; }
.nw-stat strong { font-size: 24px; font-weight: 700; color: var(--t-num); }
.nw-stat span { font-size: 12.5px; color: var(--ink-3); }
.nw-stat-divider { width: 1px; height: 26px; background: var(--line-strong); }

/* ---- 移动端分类导航（默认隐藏） ---- */
.nw-mobile-nav { display: none; }

/* ---- 博客两栏布局 ---- */
/* 用 areas 显式定位：侧栏恒左窄列、正文恒右宽列（详情页 DOM 中 main 在前，靠顺序放置会错位） */
.nw-layout { display: grid; grid-template-columns: 280px minmax(0, 1fr); grid-template-areas: "side main"; gap: 32px; padding-top: 44px; padding-bottom: 72px; align-items: start; }
.nw-sidebar { grid-area: side; position: sticky; top: 96px; display: flex; flex-direction: column; gap: 20px; }
.nw-main { grid-area: main; min-width: 0; }

/* ---- 侧栏卡片 ---- */
.nw-card { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.nw-card-title { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 700; color: var(--t-strong); }
.nw-card-title svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--accent-strong); }

/* ---- 分类树 ---- */
.nw-cate { display: flex; flex-direction: column; gap: 2px; }
.nw-cate-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 8px; font-size: 13.5px; color: var(--ink-2); text-decoration: none; transition: background .18s ease, color .18s ease; }
.nw-cate-item:hover { background: var(--accent-soft); color: var(--accent-strong); }
.nw-cate-item.is-active { background: var(--gold-grad); color: #F2EFE6; font-weight: 600; }
.nw-cate-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nw-cate-name.is-all { font-weight: 700; color: var(--accent-strong); }
.nw-cate-item.is-active .nw-cate-name.is-all { color: inherit; }
.nw-cate-count { flex-shrink: 0; min-width: 24px; text-align: center; padding: 1px 7px; border-radius: 999px; font-size: 11.5px; font-weight: 600; background: var(--paper-2); color: var(--ink-3); }
.nw-cate-item.is-active .nw-cate-count { background: rgba(255, 255, 255, .22); color: #F2EFE6; }
.nw-cate-item.is-child { padding-left: 26px; font-size: 12.5px; }

/* ---- 热门文章 ---- */
.nw-hot { display: flex; flex-direction: column; gap: 12px; }
.nw-hot-item { display: flex; gap: 10px; text-decoration: none; }
.nw-hot-rank { flex-shrink: 0; width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; background: var(--paper-2); color: var(--ink-3); }
.nw-hot-rank.is-top { background: var(--gold-grad); color: #F2EFE6; }
.nw-hot-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nw-hot-title { font-size: 13px; font-weight: 500; line-height: 1.5; color: var(--t-h3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s ease; }
.nw-hot-item:hover .nw-hot-title { color: var(--accent-strong); }
.nw-hot-meta { font-size: 11.5px; color: var(--ink-3); }

/* ---- 关于卡片 ---- */
.nw-card-about { background: linear-gradient(135deg, var(--accent-soft), var(--paper)); }
.nw-about-text { margin: 0 0 12px; font-size: 13px; line-height: 1.8; color: var(--ink-2); }
.nw-about-link { font-size: 13.5px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
.nw-about-link:hover { text-decoration: underline; }

/* ---- 文章卡片 ---- */
.nw-list { display: flex; flex-direction: column; gap: 18px; }
.nw-item { display: flex; flex-direction: row; gap: 0; overflow: hidden; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out), border-color .2s ease; }
.nw-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
.nw-item-cover { position: relative; flex-shrink: 0; width: 240px; overflow: hidden; background: var(--paper-2); line-height: 0; }
.nw-item-cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s var(--ease-out); }
.nw-item:hover .nw-item-cover img { transform: scale(1.04); }
.nw-cover-ph { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; min-height: 150px; color: var(--ink-3); }
.nw-cover-ph svg { width: 44px; height: 44px; }
.nw-cover-ph-sm { min-height: 96px; }
.nw-cover-ph-sm svg { width: 30px; height: 30px; }
.nw-item-body { display: flex; flex-direction: column; flex: 1; min-width: 0; padding: 18px 22px; }
.nw-item-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.nw-item-meta-left { display: flex; align-items: center; gap: 12px; }
.nw-item-cate { flex-shrink: 0; padding: 2px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: 12px; font-weight: 600; }
.nw-item-date { font-size: 12.5px; color: var(--ink-3); }
.nw-item-views { font-size: 12.5px; color: var(--ink-3); }
.nw-item-title { font-size: 16px; font-weight: 600; line-height: 1.5; color: var(--t-h3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s ease; }
.nw-item-title-lg { font-size: 21px; margin: 2px 0 8px; }
.nw-item:hover .nw-item-title { color: var(--accent-strong); }
.nw-item-desc { margin-top: 8px; font-size: 13.5px; line-height: 1.7; color: var(--ink-3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.nw-item-more { margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--accent-strong); }

/* ---- 头条大卡：封面在右 ---- */
.nw-item-feature { flex-direction: row-reverse; }
.nw-item-feature .nw-item-cover { width: 320px; }
.nw-item-feature .nw-item-desc { -webkit-line-clamp: 3; }
.nw-feature-badge { position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 5px; background: var(--gold-grad); color: #F2EFE6; font-size: 12px; font-weight: 700; line-height: 1.4; }

/* ---- 分页 ---- */
.nw-pagination { display: flex; justify-content: center; align-items: center; gap: 6px; margin-top: 30px; }
.nw-page-btn { min-width: 36px; height: 36px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); font-size: 14px; font-weight: 600; color: var(--ink-2); text-decoration: none; transition: all .2s ease; }
a.nw-page-btn:hover { border-color: var(--accent); color: var(--accent-strong); transform: translateY(-1px); }
.nw-page-btn.is-active { background: var(--gold-grad); border-color: transparent; color: #F2EFE6; }
.nw-page-dots { min-width: 24px; text-align: center; font-size: 14px; color: var(--ink-3); }

/* ---- 详情页：面包屑 ---- */
.nw-crumb-bar { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.nw-crumb { display: flex; align-items: center; gap: 10px; padding-top: 14px; padding-bottom: 14px; font-size: 13px; color: var(--ink-3); }
.nw-crumb a { color: var(--ink-2); text-decoration: none; }
.nw-crumb a:hover { color: var(--accent-strong); }
.nw-crumb .is-current { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 详情页：正文 ---- */
.nw-article { padding: 30px 36px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-sm); }
.nw-article-head { padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.nw-article-title { margin: 10px 0 0; font-size: 26px; font-weight: 700; line-height: 1.45; color: var(--t-strong); }
.nw-article-info { display: flex; gap: 18px; margin-top: 12px; font-size: 13px; color: var(--ink-3); }
.nw-article-desc { margin: 18px 0 0; padding: 14px 18px; border-left: 3px solid var(--accent); border-radius: 0 10px 10px 0; background: var(--paper-2); font-size: 14.5px; line-height: 1.9; color: var(--ink-2); }
.nw-article-body { margin-top: 22px; font-size: 15px; line-height: 2; color: var(--ink-2); word-break: break-word; }
.nw-article-body p { margin: 0 0 14px; }
.nw-article-body h2, .nw-article-body h3, .nw-article-body h4 { margin: 26px 0 12px; font-size: 19px; font-weight: 700; color: var(--t-h3); }
.nw-article-body img { max-width: 100%; height: auto; border-radius: 10px; }
.nw-article-body table { width: 100%; margin: 16px 0; border-collapse: collapse; font-size: 14px; }
.nw-article-body th, .nw-article-body td { padding: 10px 12px; border: 1px solid var(--line); text-align: left; }
.nw-article-body th { background: var(--paper-2); font-weight: 600; color: var(--t-h3); }
.nw-article-body blockquote { margin: 16px 0; padding: 12px 18px; border-left: 3px solid var(--accent); background: var(--paper-2); border-radius: 0 10px 10px 0; }
.nw-article-body a { color: var(--accent-strong); font-weight: 600; }
.nw-article-foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); }
.nw-back-link { font-size: 13.5px; font-weight: 600; color: var(--accent-strong); text-decoration: none; }
.nw-back-link:hover { text-decoration: underline; }
/* 岗位详情底部 CTA（投递简历 + 返回链接，recruit_detail 用） */
.nw-job-cta { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
@media (max-width: 640px) { .nw-job-cta { flex-direction: column; align-items: stretch; text-align: center; } }

/* ---- 详情页：相关文章 ---- */
.nw-related { margin-top: 32px; }
.nw-related .nw-card-title { border-bottom: 0; margin-bottom: 16px; }
.nw-related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.nw-related-card { display: flex; gap: 14px; padding: 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; box-shadow: var(--shadow-sm); transition: transform .25s var(--ease-out), box-shadow .25s var(--ease-out); }
.nw-related-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.nw-related-cover { flex-shrink: 0; width: 120px; overflow: hidden; border-radius: 8px; background: var(--paper-2); line-height: 0; }
.nw-related-cover img { width: 100%; height: 100%; min-height: 96px; object-fit: cover; display: block; }
.nw-related-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.nw-related-title { font-size: 13.5px; font-weight: 600; line-height: 1.55; color: var(--t-h3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; transition: color .2s ease; }
.nw-related-card:hover .nw-related-title { color: var(--accent-strong); }

/* ---- 响应式 ---- */
@media (max-width: 900px) {
  .nw-layout { grid-template-columns: 1fr; grid-template-areas: "side" "main"; gap: 24px; padding-top: 28px; padding-bottom: 56px; }
  .nw-sidebar { position: static; }
  .nw-item-feature .nw-item-cover { width: 100%; }
  .nw-item-feature { flex-direction: column; }
  .nw-item-feature .nw-item-cover img { height: auto; }
  .nw-article { padding: 22px 20px; }
  .nw-article-title { font-size: 21px; }
  .nw-related-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .nw-stats { gap: 16px; }
  .nw-stat strong { font-size: 20px; }
  /* 移动端：隐藏侧栏，显示横滚分类条（与老官网一致） */
  .nw-layout { grid-template-columns: 1fr; grid-template-areas: "main"; }
  .nw-sidebar { display: none; }
  .nw-mobile-nav { display: block; padding: 14px 16px 0; }
  .nw-mobile-row { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding: 4px 0; }
  .nw-mobile-row::-webkit-scrollbar { display: none; }
  .nw-mobile-sub { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--line); }
  .nw-mobile-tag { flex-shrink: 0; white-space: nowrap; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); font-size: 12px; font-weight: 500; color: var(--ink-2); text-decoration: none; }
  .nw-mobile-tag.is-active { background: var(--gold-grad); border-color: transparent; color: #F2EFE6; font-weight: 600; }
  .nw-item { flex-direction: row; }
  .nw-item-cover, .nw-item-feature .nw-item-cover { width: 110px; }
  .nw-cover-ph { min-height: 82px; }
  .nw-item-body { padding: 12px 14px; }
  .nw-item-meta, .nw-item-meta-left { flex-wrap: wrap; gap: 6px; }
  .nw-item-title { font-size: 13.5px; }
  .nw-item-title-lg { font-size: 16px; }
  .nw-item-desc, .nw-item-more { display: none; }
  .nw-item-cate { font-size: 10.5px; padding: 2px 7px; }
}

/* ---- 暗色主题可读性重映射 ----
   内联主题体系把 --ink-3 / --accent-strong 映射为「主题亮档」，deep 底上对比不足；
   次级说明统一提为白系弱化档（--ink-4），强调统一提为点缀色（--fg-accent）。 */
html[data-theme="dark"] .nw-stat span,
html[data-theme="dark"] .nw-cate-count,
html[data-theme="dark"] .nw-hot-meta,
html[data-theme="dark"] .nw-hot-rank,
html[data-theme="dark"] .nw-item-date,
html[data-theme="dark"] .nw-item-views,
html[data-theme="dark"] .nw-item-desc,
html[data-theme="dark"] .nw-cover-ph,
html[data-theme="dark"] .nw-page-dots,
html[data-theme="dark"] .nw-crumb,
html[data-theme="dark"] .nw-article-info {
  color: var(--ink-4);
}
html[data-theme="dark"] .nw-card-title svg,
html[data-theme="dark"] .nw-cate-name.is-all,
html[data-theme="dark"] .nw-about-link,
html[data-theme="dark"] .nw-hot-item:hover .nw-hot-title,
html[data-theme="dark"] .nw-item:hover .nw-item-title,
html[data-theme="dark"] .nw-item-more,
html[data-theme="dark"] a.nw-page-btn:hover,
html[data-theme="dark"] .nw-crumb a:hover,
html[data-theme="dark"] .nw-back-link,
html[data-theme="dark"] .nw-related-card:hover .nw-related-title,
html[data-theme="dark"] .nw-article-body a {
  color: var(--fg-accent);
}
html[data-theme="dark"] .nw-card,
html[data-theme="dark"] .nw-item,
html[data-theme="dark"] .nw-article,
html[data-theme="dark"] .nw-related-card {
  background: var(--glass);
  border-color: var(--glass-line);
  box-shadow: none;
}
html[data-theme="dark"] .nw-card-about { background: linear-gradient(135deg, rgba(255, 255, 255, .05), var(--glass)); }
html[data-theme="dark"] .nw-cate-item:hover { background: rgba(255, 255, 255, .06); color: var(--td-accent); }
html[data-theme="dark"] .nw-cate-item.is-active { background: var(--accent-2); color: var(--brand-deep); }
html[data-theme="dark"] .nw-cate-item.is-active .nw-cate-name.is-all { color: inherit; }
html[data-theme="dark"] .nw-cate-item.is-active .nw-cate-count { background: rgba(28, 36, 96, .25); color: var(--brand-deep); }
html[data-theme="dark"] .nw-cate-count { background: rgba(255, 255, 255, .07); }
html[data-theme="dark"] .nw-hot-rank.is-top { background: var(--accent-2); color: var(--brand-deep); }
html[data-theme="dark"] .nw-item-cate { background: rgba(255, 255, 255, .07); color: var(--td-accent); }
html[data-theme="dark"] .nw-item-cover,
html[data-theme="dark"] .nw-related-cover { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .nw-feature-badge { background: var(--accent-2); color: var(--brand-deep); }
html[data-theme="dark"] .nw-page-btn { background: var(--glass); border-color: var(--glass-line); color: var(--ink-2); }
html[data-theme="dark"] .nw-page-btn.is-active { background: var(--accent-2); border-color: transparent; color: var(--brand-deep); }
html[data-theme="dark"] .nw-crumb-bar { background: rgba(255, 255, 255, .03); border-bottom-color: var(--glass-line); }
html[data-theme="dark"] .nw-article-desc,
html[data-theme="dark"] .nw-article-body th,
html[data-theme="dark"] .nw-article-body blockquote { background: rgba(255, 255, 255, .04); }
html[data-theme="dark"] .nw-article-head,
html[data-theme="dark"] .nw-article-foot { border-color: var(--glass-line); }
html[data-theme="dark"] .nw-article-body th { color: var(--td-h); }
html[data-theme="dark"] .nw-article-body th,
html[data-theme="dark"] .nw-article-body td { border-color: var(--glass-line); }
html[data-theme="dark"] .nw-mobile-tag { background: var(--glass); border-color: var(--glass-line); color: var(--ink-2); }
html[data-theme="dark"] .nw-mobile-tag.is-active { background: var(--accent-2); border-color: transparent; color: var(--brand-deep); }
