/* =========================================================================
   article-toolzx.css —— toolzx 版文章列表/详情页（文章体系 P2，2026-11-17）
   版式来源：.workbuddy/mockups/toolzx-{list,detail}-final.html 定稿。
   颜色一律引用 tools-site.css 令牌（--bg/--ink/--muted/--faint/--border/--accent），
   禁字面色；亮暗由令牌翻转自动成立（data-theme=dark）。
   注释里禁出现注释闭合符（星号+斜杠）——本文件头曾经把这三个字符写进注释文本，
   结果提前闭合、把紧随其后的第一条规则（.art-subnav）整条吞掉：规则静默失效，
   而视觉又被 body > nav 的同名效果掩盖，查了半天以为是被覆盖。
   ========================================================================= */

/* ---------- subnav（文章栏目横排，布局壳渲染） ---------- */
/* 底线只在内容宽度内（用户定稿 2026-11-17）：底线挂 .art-subnav-in（.wrap 宽度）而不是
   外层 .art-subnav —— 挂外层会横穿整屏，与正文块断开、像一条页边线。
   副作用处理：.art-subnav-in 有 overflow-x:auto（窄屏横滚），a 的 margin-bottom:-1px 外扩
   会被裁掉 → 激活态改 box-shadow inset（内阴影不外扩、不被裁切），2px 压在 1px 底线上。 */
/* tools-site.css 的 `body > nav` 同时命中了本站顶栏与这条 subnav（两者都是 body 直接子级），
   继承来 sticky + 毛玻璃底 + 1px 底线三件套：①sticky top:0 会与顶栏抢同一个吸顶位、
   滚起来叠成两层；②底线挂外层就横穿整屏。所以这三项必须显式复位。 */
.art-subnav { position: static; border-bottom: 0; background: var(--surface); backdrop-filter: none; }
.art-subnav-in {
    display: flex; gap: 4px; height: 44px; align-items: stretch;
    overflow-x: auto; scrollbar-width: none;
    border-bottom: 1px solid var(--border);
}
.art-subnav-in::-webkit-scrollbar { display: none; }
.art-subnav-in a {
    display: flex; align-items: center; gap: 7px; padding: 0 14px;
    font-size: 14px; color: var(--muted); white-space: nowrap;
}
.art-subnav-in a:hover { color: var(--ink); }
.art-subnav-in a.on { color: var(--accent); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }
.art-subnav-n {
    font-size: 11.5px; line-height: 1; padding: 3px 7px; border-radius: 999px;
    color: var(--muted); background: var(--surface-2); border: 1px solid var(--border);
    font-variant-numeric: tabular-nums;
}

/* ---------- 页面骨架 ---------- */
.art-main { padding-bottom: 56px; }
.art-cols { display: grid; grid-template-columns: minmax(0, 1fr) 264px; gap: 44px; align-items: start; }
.page-head { padding: 34px 0 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.page-head h1 { font-size: 28px; letter-spacing: -.02em; }
.page-head .lede { color: var(--muted); font-size: 14.5px; margin-top: 8px; max-width: 560px; }
.page-head .count { color: var(--faint); font-size: 13px; white-space: nowrap; padding-bottom: 5px; }
.art-empty { color: var(--muted); padding: 40px 0 80px; }

/* ---------- chip / 热度（列表与详情共用） ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 11px; border-radius: 999px; }
.c-tag { color: var(--muted); background: transparent; border: 1px solid var(--border); }
/* 标签 chip 内链化（文章体系 P3）：chip 变 a 后剥掉链接默认样式，视觉与原 span 版一致 */
a.chip { color: inherit; text-decoration: none; }
a.chip:hover { color: var(--accent); border-color: var(--accent); }
.heat { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12.5px; }
.heat svg { width: 12px; height: 12px; flex: 0 0 auto; }

/* ---------- hero 首条 ---------- */
.art-hero { display: grid; grid-template-columns: 1fr 320px; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 12px; transition: box-shadow .2s ease; }
/* 无封面 → 单列（用户定稿 2026-11-17：没有封面图就不要拿同一张占位图充数——
   每个条目都用同一张线稿图标，等于告诉读者「这站的文章都没图」）。
   Razor 侧按 CoverPath 判定是否输出 .pic，并在无图时挂 .solo。 */
.art-hero.solo { grid-template-columns: 1fr; }
.art-hero:hover { box-shadow: var(--shadow-card-hover); }
.art-hero .txt { padding: 24px 26px; display: flex; flex-direction: column; }
.art-hero .chip { align-self: flex-start; }
.art-hero h2 { font-size: 20px; line-height: 1.4; letter-spacing: -.015em; margin-top: 12px; }
.art-hero h2 a { color: var(--ink); }
.art-hero:hover h2 a { color: var(--accent); }
.art-hero .abs { color: var(--muted); font-size: 14.5px; margin-top: 10px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.art-hero .meta { margin-top: auto; padding-top: 16px; font-size: 13px; color: var(--faint); }
.art-hero .pic { position: relative; min-height: 200px; background: var(--accent-soft); }
.art-hero .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- hero-side 双卡 ---------- */
.hero-side { display: flex; flex-direction: column; gap: 12px; margin-bottom: 12px; }
.mini { display: flex; gap: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; align-items: center; transition: box-shadow .2s ease; }
.mini:hover { box-shadow: var(--shadow-card); }
.mini .txt { min-width: 0; flex: 1; }
.mini h3 { font-size: 15.5px; font-weight: 600; line-height: 1.4; letter-spacing: -.01em; }
.mini h3 a { color: var(--ink); }
.mini:hover h3 a { color: var(--accent); }
.mini .meta { margin-top: 8px; display: flex; align-items: center; gap: 10px; font-size: 12.5px; color: var(--faint); }
/* 缩略图位只在有封面时输出（无图 → 纯文字条目，文本自动占满整行）。
   同一张线稿图标铺在每条上等于自曝「全站无图」，比没有图更廉价。 */
.mini .thumb, .feed .thumb { width: 96px; height: 68px; border-radius: 8px; flex: 0 0 auto; overflow: hidden; background: var(--surface-2); }
.mini .thumb img, .feed .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ---------- feed 流 ---------- */
.sec-label { display: flex; align-items: baseline; gap: 12px; margin: 26px 0 4px; }
.sec-label h2 { font-size: 18px; letter-spacing: -.01em; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: flex; gap: 16px; padding: 12px 16px; margin: 0 -12px 8px; border-bottom: 1px solid var(--border); border-radius: 12px; align-items: flex-start; transition: background-color .15s ease; }
.feed li:hover { background: var(--surface-2); }
.feed .txt { min-width: 0; flex: 1; }
.feed h3 { font-size: 16px; font-weight: 600; line-height: 1.45; letter-spacing: -.01em; }
.feed h3 a { color: var(--ink); }
.feed h3 a:hover { color: var(--accent); }
.feed .abs { color: var(--muted); font-size: 14px; margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed .meta { margin-top: 10px; display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--faint); }
.feed .feed-date { margin-left: auto; }

/* ---------- 分页（_Pager 输出的类名做轻适配） ---------- */
.art-main-col .pager { display: flex; gap: 20px; align-items: center; padding: 26px 4px 0; font-size: 14px; }
.art-main-col .pager a { color: var(--accent); }
.art-main-col .pager-total { color: var(--faint); }

/* ---------- 侧栏 ---------- */
.art-side { display: flex; flex-direction: column; gap: 16px; margin-top: 34px; }
.art-side .card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; }
.art-side .card h4 { font-size: 14px; font-weight: 700; letter-spacing: -.01em; margin-bottom: 12px; }
.art-side .card ul { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.art-side .cats a { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: var(--muted); }
.art-side .cats a:hover { color: var(--ink); }
.art-side .cats a.on { color: var(--accent); font-weight: 600; }
.art-side .cats em { margin-left: auto; font-style: normal; font-size: 12px; color: var(--faint); font-variant-numeric: tabular-nums; }
.art-side .hot li { padding: 5px 0; }
.art-side .hot a { color: var(--muted); line-height: 1.5; }
.art-side .hot a:hover { color: var(--accent); }
.art-side .try-card .t { font-weight: 700; font-size: 14.5px; }
.art-side .try-card .d { font-size: 13px; color: var(--muted); margin: 6px 0 12px; line-height: 1.6; }
.art-side .try-card .go { display: block; text-align: center; background: var(--accent); color: #fff; border-radius: 8px; padding: 8px 0; font-size: 13.5px; font-weight: 600; }
.art-side .try-card .go:hover { opacity: .92; }

/* ---------- 详情页 ---------- */
.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 220px; gap: 64px; align-items: start; }
.head { padding: 36px 0 0; max-width: 720px; }
.crumb { font-size: 13px; color: var(--faint); margin-bottom: 20px; }
.crumb a { color: var(--muted); }
.crumb a:hover { color: var(--accent); }
.head .chip { margin-bottom: 12px; }
.head h1 { font-size: 28px; line-height: 1.32; letter-spacing: -.02em; }
.head .sub { color: var(--muted); font-size: 15px; margin-top: 12px; line-height: 1.6; letter-spacing: 0.01em; }
.head .facts { margin-top: 16px; font-size: 13px; color: var(--faint); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.head::after { content: ""; display: block; height: 1px; background: var(--border); margin-top: 20px; }

.body { max-width: 700px; margin-top: 30px; font-size: 16px; line-height: 1.78; letter-spacing: 0.01em; }
/* 窄屏正文兜底（2026-11-17）：单列后正文宽度＝视口，任何「不肯换行」的东西都会把整页撑出
   横向滚动条——长 URL/长英文串、宽表格、代码块。三处各给各的出路：
   长词断开、表格自身横向滚动、代码块已有 overflow-x。 */
.body { overflow-wrap: anywhere; }
.body table { display: block; max-width: 100%; overflow-x: auto; }
.body p { margin: 0 0 18px; }
@media (min-width: 761px) {
  .body .lead-cap::first-letter { float: left; font-size: 48px; line-height: .9; padding: 6px 10px 0 0; font-weight: 700; color: var(--accent); }
}
.body h2 { font-size: 20px; font-weight: 600; letter-spacing: -.01em; margin: 40px 0 14px; line-height: 1.4; }
.body h2 .no { color: var(--accent); font-size: 13px; font-weight: 700; letter-spacing: .1em; display: block; margin-bottom: 6px; font-variant-numeric: tabular-nums; }
.body h3 { font-size: 17px; margin: 28px 0 10px; }
.body ul, .body ol { margin: 0 0 20px; padding-left: 26px; }
.body li { margin-bottom: 6px; }
.body strong { color: var(--ink); }
.body code { background: rgba(110,118,129,0.15); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 14.5px; font-family: var(--mono); }
.body pre { background: #0d1117; color: #e6e8eb; border-radius: 10px; padding: 18px 20px; overflow-x: auto; margin: 0 0 20px; font-size: 14px; line-height: 1.7; }
.body pre code { background: none; border: 0; padding: 0; color: inherit; }
.body table { width: 100%; border-collapse: collapse; margin: 0 0 22px; font-size: 14.5px; background: var(--surface); }
.body th { text-align: left; font-size: 13px; letter-spacing: .05em; color: var(--faint); font-weight: 600; }
.body th, .body td { border-bottom: 1px solid var(--border); padding: 10px 6px; }
.body tr:last-child td { border-bottom: 0; }
.body img { max-width: 100%; height: auto; border-radius: 10px; }
.body blockquote { margin: 0 0 20px; padding: 2px 0 2px 20px; border-left: 3px solid var(--accent); color: var(--muted); }

/* 速览框 / 金句 / 划重点（富文本可用的结构块，白底发丝线 + 3px 蓝左边框一处） */
.keypoints, .takeaway { background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 10px; padding: 20px 24px; margin: 0 0 34px; }
.keypoints .kt, .takeaway .kt { font-size: 13px; font-weight: 700; color: var(--ink); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.keypoints .kt::before, .takeaway .kt::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--accent); }
.keypoints ul, .takeaway ul { margin: 0; padding: 0; list-style: none; font-size: 14.5px; }
.keypoints li, .takeaway li { padding: 5px 0; margin: 0; color: var(--muted); }
.keypoints li::before { content: "—"; color: var(--accent); margin-right: 10px; }
.takeaway { margin-top: 44px; }
.takeaway .kt { font-size: 16px; }
.takeaway li::before { content: "✓"; margin-right: 10px; font-weight: 700; }
.pull { margin: 36px 0; padding: 0 0 0 26px; border-left: 3px solid var(--accent); font-size: 19px; line-height: 1.6; color: var(--ink); }

/* 标签行（详情底部） */
.art-tags { display: flex; gap: 8px; flex-wrap: wrap; max-width: 700px; margin-top: 26px; }

/* 工具 CTA（_ToolCta 输出的 .tool-cta 形状，按 mockup next-step 口径重排） */
.tool-cta { max-width: 700px; margin-top: 16px; border: 1px solid var(--border); border-radius: 12px; padding: 20px 24px; background: var(--surface); }
.tool-cta h2 { font-size: 15.5px; font-weight: 700; margin-bottom: 12px; }
.tool-cta .cta-main { display: flex; align-items: center; gap: 14px; background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; }
/* 工具名不参与收缩（2026-11-17）：手机上「反应速度测试」原来被 desc 与按钮一起挤压，
   挤成两行还把字撑变形 —— 名称是这条卡的信息主体，必须整串不折行。 */
.tool-cta .cta-name { flex: 0 0 auto; font-weight: 600; font-size: 15px; color: var(--accent); white-space: nowrap; }
.tool-cta .cta-desc { flex: 1 1 auto; font-size: 13px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-cta .cta-go { margin-left: auto; flex: 0 0 auto; background: var(--accent); color: #fff; font-size: 13.5px; font-weight: 600; padding: 7px 16px; border-radius: 8px; }
.tool-cta .cta-go:hover { opacity: .92; }
.tool-cta .cta-more { list-style: none; margin: 10px 0 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; font-size: 13.5px; }
.tool-cta .cta-more a { color: var(--muted); }
.tool-cta .cta-more a:hover { color: var(--accent); }

/* 正文前的工具快捷条（2026-11-17）：一条轻量提示，不做成第二张卡（卡在文末已有）。
   手机档名称与「直接用」必须同一行不挤压 —— 名称 nowrap + 省略，出口钮不收缩。 */
.art-toolhint {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 22px; padding: 10px 14px;
  border-radius: 10px; background: var(--accent-soft);
  color: var(--accent-deep); text-decoration: none;
  font-size: 13.5px; min-height: 44px;
}
.art-toolhint b { font-weight: 600; }
.art-toolhint > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.art-toolhint-go { margin-left: auto; flex: 0 0 auto; font-weight: 600; white-space: nowrap; }
.art-toolhint:hover { background: color-mix(in srgb, var(--accent) 14%, var(--surface)); }
.art-toolhint:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 相关阅读 */
.end { max-width: 700px; margin-top: 44px; }
.end h4 { font-size: 16px; font-weight: 700; margin-bottom: 14px; }
.end .rel { list-style: none; margin: 0; padding: 0; }
.end .rel li { display: flex; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; font-size: 14.5px; transition: box-shadow .15s ease; }
.end .rel li:hover { box-shadow: var(--shadow-card); }
.end .rel a { color: var(--ink); min-width: 0; }
.end .rel a:hover { color: var(--accent); }
.end .back { display: inline-block; margin-top: 14px; font-size: 14px; color: var(--muted); }
.end .back:hover { color: var(--accent); }

/* 右栏目录 + 推荐工具 */
.toc { position: sticky; top: 24px; margin-top: 36px; font-size: 13.5px; }
.toc .t { font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--faint); margin-bottom: 10px; }
.toc ol { list-style: none; margin: 0 0 24px; padding: 0; border-left: 1px solid var(--border); }
.toc ol li a { display: block; padding: 5px 0 5px 14px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-left: 2px solid transparent; margin-left: -1px; }
.toc ol li a:hover { color: var(--ink); }
.toc ol li a.on { color: var(--accent); font-weight: 600; border-left-color: var(--accent); }
.toc .toc-tools { list-style: none; margin: 0; padding: 0; }
.toc .toc-tools li a { display: block; padding: 6px 0; color: var(--muted); }
.toc .toc-tools li a:hover { color: var(--accent); }

/* 阅读进度条 */
.read-progress { position: fixed; top: 0; left: 0; height: 2px; width: 0%; background: var(--accent); z-index: 99; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
    /* ★ 单列必须写 minmax(0, 1fr) 而不是 1fr（2026-11-17 用户报障：/article/qrcode-guide.html
       手机右侧顶出屏幕、页面能左右拖）。1fr 的最小尺寸是 auto＝min-content，正文里只要有一个
       不肯收缩的东西（长标签、代码块里的长行、表格），整列就被顶到 481px（视口 393 → 溢出 88px），
       .art-cols 的单列因此失效。minmax(0, 1fr) 把下限钉成 0，超长内容由各自容器滚动/截断。 */
    .art-cols, .detail-cols { grid-template-columns: minmax(0, 1fr); gap: 0; }
    .art-side { margin-top: 28px; }
    .toc { position: static; margin-top: 28px; padding: 0 0 20px; }
    .art-hero { grid-template-columns: 1fr; }
    .art-hero .pic { min-height: 140px; }
}
@media (max-width: 760px) {
    .page-head h1 { font-size: 24px; }
    .head h1 { font-size: 24px; }
    .body { font-size: 15px; line-height: 1.75; }
    .feed li { margin: 0 -6px 6px; padding: 16px 10px; }
    .mini .thumb, .feed .thumb { display: none; }
}
/* 手机档（2026-11-17）：文末工具卡三件挤一行会把工具名压变形 —— 名称与出口钮占第一行，
   描述整行下移到第二行；开头快捷条的内距同步收一档。 */
@media (max-width: 560px) {
  .tool-cta { padding: 16px 14px; }
  .tool-cta .cta-main { flex-wrap: wrap; gap: 6px 10px; padding: 12px 14px; }
  .tool-cta .cta-desc { flex: 1 1 100%; order: 3; }
  .tool-cta .cta-go { margin-left: auto; }
  .art-toolhint { padding: 10px 12px; font-size: 13px; }
}
