/**
 * 文章模块样式（article/index + category + tag + search + detail）
 * 提取自各模板内联 <style>，合并去重后按组件分区
 *
 * 引入方式：<link rel="stylesheet" href="/static/css/article.css" />
 * 全局基础样式已在 style.css 中定义，此处仅做页面级扩展
 */

/* ========================================================================
   1. 通用组件（多页面共享）
   ======================================================================== */

/* 面包屑 ol 语义化（index / search / detail 共用） */
.breadcrumb ol { display: flex; align-items: center; gap: 8px; list-style: none; padding: 0; margin: 0; flex-wrap: wrap; }

/* 侧边栏卡片（category / tag / search 共用） */
.sidebar-card { background: var(--c-card); border-radius: var(--r-lg); padding: 24px; box-shadow: var(--sh-sm); margin-bottom: 24px; }
.sidebar-card h4 { font-size: 1.05rem; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--c-line); display: flex; align-items: center; gap: 8px; }
.sidebar-card h4 .ico { width: 18px; height: 18px; color: var(--c-primary); }

/* 8.12 补充修复3.4：侧栏卡片标题行（标题 + 更多链接，两端对齐） */
.sidebar-card__title-row { justify-content: space-between; }
.sidebar-card__title { display: flex; align-items: center; gap: 8px; }
.sidebar-card__more { font-size: var(--fs-xs); color: var(--c-primary); font-weight: 500; text-decoration: none; white-space: nowrap; }
.sidebar-card__more:hover { text-decoration: underline; }

/* 8.12 补充修复3.4：标签索引页全量标签云（.tag-cloud--large） */
.tag-cloud--large { display: flex; flex-wrap: wrap; gap: 12px; }
.tag-cloud__item { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: var(--r-md); background: var(--c-bg-soft); color: var(--c-ink); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; transition: all .2s; }
.tag-cloud__item:hover { background: var(--c-primary-soft); color: var(--c-primary); transform: translateY(-2px); }
.tag-cloud__item--hot { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 600; }
.tag-cloud__count { font-size: var(--fs-xs); color: var(--c-muted); }
.tag-cloud-card { padding: 32px; border-radius: var(--r-lg); box-shadow: var(--sh-sm); background: var(--c-card); }

/* 热门排行列表（category / tag / search / index 共用） */
.hot-list { display: flex; flex-direction: column; gap: 14px; }
.hot-item { display: flex; gap: 12px; align-items: flex-start; }
.hot-num { width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 700; background: var(--c-primary-soft); color: var(--c-primary); }
.hot-item:nth-child(1) .hot-num { background: var(--c-grad); color: #fff; }
.hot-item h5 { font-size: var(--fs-sm); font-weight: 600; color: var(--c-ink); line-height: 1.4; margin-bottom: 4px; }
.hot-item:hover h5 { color: var(--c-primary); }
.hot-item .hot-meta { font-size: var(--fs-xs); color: var(--c-muted); }

/* 空状态：已统一至 enhance.css（.empty-state 全局共用，单一权威来源） */

/* 区段标题行（标题 + 操作按钮水平排列，index 视频区等共用） */
.sec-head-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.sec-head-row .sec-head { margin: 0; }

/* 区段去顶部内边距（紧接上方区块时使用，search 页等） */
.section--flush-top { padding-top: 0; }

/* ========================================================================
   2. 文章行卡片扩展（覆盖 style.css 中 .res-row 基础样式）
   ======================================================================== */

/* 通用行卡片扩展（category / tag / search） */
.res-row { padding: var(--sp-lg); }
.res-row .res-thumb { width: 200px; height: 130px; }
.res-row h3 { font-size: 1.15rem; margin-bottom: 8px; line-height: 1.4; }
.res-row .row-excerpt { color: var(--c-muted); font-size: var(--fs-sm); margin-bottom: 12px; line-height: 1.7; }
.res-row .res-meta { gap: 12px; }
.res-row .res-meta .read-more,
.res-row .read-more { color: var(--c-primary); font-weight: 600; margin-left: auto; display: inline-flex; align-items: center; gap: 4px; }
.res-row .res-meta .read-more svg,
.res-row .read-more svg { width: 14px; height: 14px; transition: transform .25s; }
.res-row:hover .res-meta .read-more svg,
.res-row:hover .read-more svg { transform: translateX(3px); }
.res-row:hover h3 { color: var(--c-primary); }
.res-row .res-tag { display: inline-flex; align-items: center; }

/* 搜索结果行微调 */
.res-row .res-url { color: var(--c-success); font-size: var(--fs-xs); display: inline-flex; align-items: center; gap: 4px; }
.res-row .res-url svg { width: 12px; height: 12px; }

/* 关键词高亮 */
.res-row mark { background: var(--c-primary-soft); color: var(--c-primary); padding: 1px 4px; border-radius: 4px; font-weight: 600; }

/* ========================================================================
   3. 文章列表首页（page-article-index）
   ======================================================================== */

/* 特色文章横幅 */
.feature-article { display: grid; grid-template-columns: 1.1fr 1fr; gap: 0; padding: 0; overflow: hidden; align-items: stretch; }
.feature-article .card-img { aspect-ratio: auto; min-height: 380px; border-radius: 0; position: relative; }
.feature-article .card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.feature-article .fa-body { padding: 44px; display: flex; flex-direction: column; justify-content: center; }
.feature-article .fa-body .tag { align-self: flex-start; margin-bottom: 16px; }
.feature-article .fa-body h2 { font-size: var(--fs-h1); margin-bottom: 14px; line-height: 1.3; color: var(--c-ink); }
.feature-article .fa-body .fa-excerpt { color: var(--c-muted); margin-bottom: 24px; line-height: 1.85; }
.feature-article .fa-body .fa-meta { display: flex; align-items: center; gap: 14px; font-size: var(--fs-xs); color: var(--c-muted); margin-bottom: 24px; flex-wrap: wrap; }
.feature-article:hover h2 { color: var(--c-primary); }

/* 文章卡片图片填充 */
.article-card .card-img { position: relative; overflow: hidden; }
.article-card .card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* 双栏热门排行区 */
.hot-rank-layout { display: grid; grid-template-columns: 1fr 340px; gap: 36px; align-items: start; }
.hot-rank-main { display: flex; flex-direction: column; gap: 18px; }

/* 横向文章行 */
.article-row { display: grid; grid-template-columns: 220px 1fr; gap: 0; padding: 0; overflow: hidden; }
.article-row .card-img { aspect-ratio: 4/3; border-radius: 0; position: relative; }
.article-row .card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.article-row .row-body { padding: 20px 24px; display: flex; flex-direction: column; }
.article-row .article-meta { margin-bottom: 8px; }
.article-row h3 { font-size: 1.1rem; margin-bottom: 8px; line-height: 1.4; }
.article-row .row-excerpt { color: var(--c-muted); font-size: var(--fs-sm); flex: 1; line-height: 1.7; }
.article-row .row-meta { display: flex; align-items: center; gap: 12px; font-size: var(--fs-xs); color: var(--c-muted); margin-top: 12px; }
.article-row:hover h3 { color: var(--c-primary); }

/* 视频卡片 */
.video-card .card-img { position: relative; }
.video-card .card-img img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.play-btn { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 60px; height: 60px; border-radius: 50%; background: rgba(255,255,255,.92); display: grid; place-items: center; color: var(--c-primary); box-shadow: var(--sh-lg); z-index: 2; transition: transform .3s; }
.video-card:hover .play-btn { transform: translate(-50%, -50%) scale(1.1); }
.play-btn svg { width: 26px; height: 26px; margin-left: 3px; }
.video-meta { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); color: var(--c-muted); }
.video-meta svg { width: 14px; height: 14px; }

/* ========================================================================
   4. 分类/标签页布局
   ======================================================================== */

/* 分类双栏布局 */
.category-layout { display: grid; grid-template-columns: 1fr 320px; gap: 36px; align-items: start; }
.category-main { display: flex; flex-direction: column; gap: 18px; }

/* 标签筛选栏 */
.filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; padding: 20px 24px; margin-bottom: 28px; }
.filter-bar .tag-cloud { gap: 10px; }
.filter-bar .tag-cloud a { padding: 8px 18px; font-size: var(--fs-sm); font-weight: 600; }
.filter-search { display: flex; gap: 10px; align-items: center; }
.filter-search .input { min-width: 220px; }

/* CTA 侧栏卡片（渐变背景，category / tag 共用）
   提取自模板内联 style，符合 CODE_STANDARDS §3.5（内联样式仅限变量注入/JS显隐/图标/动态布局） */
.sidebar-cta { background: var(--c-grad); color: #fff; text-align: center; padding: 28px 24px; border-radius: var(--r-lg); box-shadow: var(--sh-sm); margin-bottom: 24px; }
.sidebar-cta__icon { width: 40px; height: 40px; margin: 0 auto 12px; display: block; }
.sidebar-cta__icon svg { width: 100%; height: 100%; }
.sidebar-cta__title { color: #fff; margin-bottom: 8px; font-size: 1.05rem; }
.sidebar-cta__desc { color: rgba(255,255,255,.85); font-size: var(--fs-sm); margin-bottom: 18px; }

/* ========================================================================
   5. 搜索页（page-article-search / page-search-result）
   ======================================================================== */

/* 大搜索框 */
.search-hero { padding: 40px 0 8px; }
.search-hero .search-box { display: flex; gap: 12px; align-items: stretch; background: var(--c-card); border-radius: var(--r-lg); padding: 10px; box-shadow: var(--sh-md); border: 2px solid var(--c-primary-soft); }
.search-hero .search-box .search-icon { width: 24px; height: 24px; color: var(--c-primary); align-self: center; margin-left: 12px; flex-shrink: 0; }
.search-hero .search-box input { flex: 1; border: none; outline: none; background: transparent; font-size: 1.1rem; padding: 14px 8px; color: var(--c-ink); font-family: inherit; }
.search-hero .search-box input::placeholder { color: var(--c-muted); }
.search-hero .search-box .btn { padding: 14px 32px; font-size: var(--fs-sm); }
.search-hero .search-summary { margin-top: 20px; color: var(--c-muted); font-size: var(--fs-sm); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.search-hero .search-summary .kw { color: var(--c-primary); font-weight: 700; }
.search-hero .search-summary .count { color: var(--c-ink); font-weight: 700; }

/* 搜索双栏布局 */
.search-layout { display: grid; grid-template-columns: 1fr 320px; gap: 36px; align-items: start; }
.search-main { display: flex; flex-direction: column; gap: 16px; }

/* 搜索空状态 */
.search-empty { text-align: center; padding: 60px 20px; background: var(--c-card); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.search-empty .empty-ico { width: 72px; height: 72px; margin: 0 auto 20px; color: var(--c-muted); opacity: .55; }
.search-empty .empty-ico svg { width: 100%; height: 100%; }
.search-empty h3 { font-size: 1.3rem; margin-bottom: 10px; color: var(--c-ink); }
.search-empty p { color: var(--c-muted); margin-bottom: 24px; max-width: 420px; margin-left: auto; margin-right: auto; line-height: 1.7; }
.search-empty .empty-tips { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin-top: 16px; }

/* ========================================================================
   6. 文章详情页（page-article-detail）
   ======================================================================== */

/* 文章头部 meta */
.article-meta-bar { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--c-line); font-size: var(--fs-sm); color: var(--c-muted); }
.article-meta-bar .author { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--c-ink); }
.article-meta-bar .author svg { width: 16px; height: 16px; color: var(--c-primary); }

/* 封面大图 */
.article-cover { width: 100%; aspect-ratio: 16/8; object-fit: cover; border-radius: var(--r-md); margin-bottom: 30px; box-shadow: var(--sh-md); }

/* 视频播放区块 */
.article-video { position: relative; width: 100%; margin-bottom: 30px; border-radius: var(--r-md); overflow: hidden; box-shadow: var(--sh-md); background: #000; }
.article-video .video-js { width: 100% !important; }
.article-video .vjs-big-play-button { font-size: 2.5em; }
.article-video__iframe { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; }
.article-video__iframe iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article-video__fallback { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 60px 20px; color: #fff; text-decoration: none; background: linear-gradient(135deg, var(--c-primary), #1a1a2e); transition: opacity .25s; }
.article-video__fallback:hover { opacity: .92; }
.article-video__play-icon { font-size: 3rem; width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.2); }
.article-video__duration { position: absolute; left: 12px; top: 12px; background: rgba(0,0,0,.75); color: #fff; padding: 4px 10px; border-radius: var(--r-sm); font-size: var(--fs-xs); z-index: 5; pointer-events: none; font-variant-numeric: tabular-nums; }

/* 正文 */
.article-prose { max-width: 100%; margin: 0; }
.article-prose img.inline-fig { width: 100%; border-radius: var(--r-md); margin: var(--sp-lg) 0; box-shadow: var(--sh-md); }
.article-prose .fig-caption { display: block; text-align: center; color: var(--c-muted); font-size: var(--fs-xs); margin-top: -10px; margin-bottom: var(--sp-md); }

/* 标签 + 分享 */
.article-foot { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 24px 0; margin-top: 28px; border-top: 1px solid var(--c-line); flex-wrap: wrap; }
.article-foot .tag-cloud { gap: 8px; }
.article-foot .tag-cloud a { padding: 6px 14px; }
.share-group { display: flex; align-items: center; gap: 10px; }
.share-group .share-label { font-size: var(--fs-sm); color: var(--c-muted); }
.share-btn { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--c-bg-soft); color: var(--c-text); transition: all .25s; border: none; cursor: pointer; }
.share-btn:hover { background: var(--c-primary-soft); color: var(--c-primary); transform: translateY(-2px); }
.share-btn svg { width: 18px; height: 18px; }

/* 兄弟页导航 */
.sibling-nav { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-lg); margin-top: var(--sp-xl); }
.sibling-nav a { display: flex; flex-direction: column; gap: 6px; padding: 18px 22px; border-radius: var(--r-md); background: var(--c-bg-soft); transition: all .25s; }
.sibling-nav a:hover { background: var(--c-primary-soft); transform: translateY(-2px); }
.sibling-nav .nav-label { font-size: var(--fs-xs); color: var(--c-muted); display: flex; align-items: center; gap: 4px; }
.sibling-nav .nav-label svg { width: 14px; height: 14px; }
.sibling-nav .nav-title { font-weight: 600; color: var(--c-ink); font-size: var(--fs-sm); line-height: 1.4; }
.sibling-nav a:hover .nav-title { color: var(--c-primary); }
.sibling-nav .next { text-align: right; }
.sibling-nav .next .nav-label { justify-content: flex-end; }
.sibling-nav .is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ========================================================================
   7. 响应式
   ======================================================================== */

@media (max-width: 1024px) {
  .hot-rank-layout { grid-template-columns: 1fr; }
  .category-layout { grid-template-columns: 1fr; }
  .search-layout { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  /* 首页 */
  .feature-article { grid-template-columns: 1fr; }
  .feature-article .card-img { min-height: 220px; }
  .feature-article .fa-body { padding: 28px; }
  .feature-article .fa-body h2 { font-size: 1.5rem; }
  .article-row { grid-template-columns: 1fr; }
  .article-row .card-img { aspect-ratio: 16/9; }
  /* 分类胶囊在窄屏支持横向滚动 */
  .capsule-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .capsule-nav::-webkit-scrollbar { display: none; }
  .capsule-nav a { flex-shrink: 0; }
  /* 分类/标签 */
  .filter-bar { flex-direction: column; align-items: stretch; }
  .filter-search { width: 100%; }
  .filter-search .input { flex: 1; min-width: 0; }
  /* 搜索 */
  .search-hero .search-box { flex-direction: column; gap: 8px; padding: 12px; }
  .search-hero .search-box .search-icon { margin: 4px 0 0 0; }
  .search-hero .search-box input { text-align: center; }
  .search-hero .search-box .btn { width: 100%; }
  .res-row { flex-direction: column; }
  .res-row .res-thumb { width: 100%; height: 180px; }
  /* 详情 */
  .sibling-nav { grid-template-columns: 1fr; }
  .sibling-nav .next { text-align: left; }
  .sibling-nav .next .nav-label { justify-content: flex-start; }
  .article-foot { flex-direction: column; align-items: flex-start; }
  /* 文章头部 meta：紧凑化 */
  .article-meta-bar { gap: 12px; padding-bottom: 16px; margin-bottom: 20px; font-size: var(--fs-xs); }
  .article-meta-bar .author svg { width: 14px; height: 14px; }
  /* 封面大图：小屏降低高度 */
  .article-cover { aspect-ratio: 16/9; margin-bottom: 22px; }
  /* 视频播放区块：紧凑化 */
  .article-video { margin-bottom: 22px; }
  .article-video__play-icon { width: 56px; height: 56px; font-size: 2.25rem; }
  .article-video__duration { top: 10px; left: 10px; padding: 3px 8px; }
  .article-video__fallback { padding: 44px 16px; }
  /* 正文：字号/间距收敛 */
  .article-prose { line-height: 1.8; }
  .article-prose img.inline-fig { margin: var(--sp-md) 0; }
  /* 标签 + 分享：紧凑化 */
  .article-foot { gap: 14px; padding: 20px 0; }
  .share-group { gap: 8px; }
  .share-btn { width: 34px; height: 34px; }
  .share-btn svg { width: 16px; height: 16px; }
  /* 兄弟页导航：紧凑化 */
  .sibling-nav a { padding: 14px 16px; }
}

@media (max-width: 480px) {
  /* 文章头部 meta：进一步紧凑 */
  .article-meta-bar { gap: 8px; padding-bottom: 12px; margin-bottom: 16px; }
  /* 封面大图：进一步降低高度 */
  .article-cover { margin-bottom: 18px; border-radius: var(--r-sm); }
  /* 视频播放区块：进一步缩小播放图标 */
  .article-video { margin-bottom: 18px; border-radius: var(--r-sm); }
  .article-video__play-icon { width: 48px; height: 48px; font-size: 1.75rem; }
  .article-video__duration { top: 8px; left: 8px; font-size: 10px; padding: 2px 6px; }
  .article-video__fallback { padding: 36px 12px; }
  /* 正文：进一步收敛 */
  .article-prose img.inline-fig { margin: var(--sp-sm) 0; }
  /* 标签 + 分享：进一步紧凑 */
  .article-foot { padding: 16px 0; }
  .article-foot .tag-cloud a { padding: 5px 10px; font-size: var(--fs-xs); }
  .share-btn { width: 32px; height: 32px; }
  .share-btn svg { width: 14px; height: 14px; }
  /* 兄弟页导航：进一步紧凑 */
  .sibling-nav a { padding: 12px 14px; }
  .sibling-nav .nav-title { font-size: var(--fs-xs); }
}
