/* DXTool（大雄工具）页面补充样式（在 design-system.css 基础上追加） */

/* ===== 工具页 ===== */
/* body 为纵向 flex，margin: 0 auto 会让本节点按内容收缩；显式 width 100% 保证筛选切换时宽度稳定 */
.tool-section { width: 100%; max-width: none; margin: 0 auto; padding: var(--breadcrumb-gap) var(--pad-x) 40px; }
/* 表单型工具（JWT 签发、Mock 数据、随机密码、图片互转）：工作区限宽居中，避免宽屏下大片空白 */
.container.tool-page--form { max-width: 1160px; margin: 0 auto; }
.tool-header { margin-bottom: 20px; }
.tool-header h1 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.tool-header p { font-size: 14px; color: var(--text-secondary); }
.toolbar { display: flex; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.btn {
    padding: 8px 20px; border-radius: var(--radius-btn); font-size: 14px; font-weight: 500;
    border: 1px solid var(--border); background: var(--surface); color: var(--text-body); cursor: pointer; transition: all .2s;
}
.btn:hover { border-color: var(--primary); color: var(--primary); }
.btn-primary { background: var(--gradient); color: #fff; border: none; }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(76,88,190,.35); transform: translateY(-1px); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #389e0d; color: #fff; }
/* ===== 工具页（统一骨架，对齐原型 DT-P03） ===== */
.tool-workspace { margin-top: 24px; }
.tool-panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tool-panel { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card); overflow: hidden; }
.tool-panel-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 16px; border-bottom: 1px solid var(--border-light); background: var(--bg);
}
.tool-panel-head .t { font-size: 13px; font-weight: 600; color: var(--text-body); }
.tool-panel-head .ops { display: flex; gap: 8px; }
.op-btn {
    padding: 4px 12px; font-size: 12px; border-radius: 6px; border: 1px solid var(--border);
    background: var(--surface); color: var(--text-body); cursor: pointer; transition: all .15s;
}
.op-btn:hover { border-color: var(--primary); color: var(--primary); }
.op-btn:disabled { opacity: .45; cursor: not-allowed; }
.op-btn:disabled:hover { border-color: var(--border); color: var(--text-body); }
.op-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-panel textarea {
    width: 100%; min-height: 320px; border: none; outline: none; resize: vertical;
    padding: 14px 16px; font-family: 'Fira Code', Consolas, monospace; font-size: 13px; line-height: 1.6;
}
.tool-options { display: flex; gap: 16px; align-items: center; margin-top: 16px; font-size: 13px; color: var(--text-secondary); flex-wrap: wrap; }
.tool-options label { display: flex; align-items: center; gap: 6px; }

/* ===== 代码工作区（IntelliJ Light）=====
   只作用于 .tool-workspace 内的输入输出面板；导航、侧栏、面包屑、工具说明、常见问题保持浅色。
   颜色全部走 --code-* 变量组，与页面底色解耦，换肤只改变量。 */
.tool-workspace .tool-panel { background: var(--code-bg); border-color: var(--code-border); }
.tool-workspace .tool-panel-head { background: var(--code-head-bg); border-bottom-color: var(--code-btn-border); }
.tool-workspace .tool-panel-head .t { color: var(--code-text); }
.tool-workspace .tool-panel textarea,
.tool-workspace .code-editor textarea {
    background: var(--code-bg) !important; color: var(--code-text) !important; caret-color: var(--code-text);
}
.tool-workspace .tool-panel textarea::placeholder { color: var(--code-muted); }
.tool-workspace .tool-panel textarea[readonly],
.tool-workspace .code-editor textarea[readonly] { background: var(--code-bg-alt) !important; }
.tool-workspace .op-btn { background: var(--code-btn-bg); border-color: var(--code-btn-border); color: var(--code-text); }
.tool-workspace .op-btn:hover { border-color: var(--code-accent); color: var(--code-accent); background: var(--surface-hover); }
.tool-workspace .op-btn:disabled { opacity: 1; color: var(--code-muted); background: var(--code-bg-alt); border-color: var(--code-border); }
.tool-workspace .op-btn:disabled:hover { border-color: var(--code-border); color: var(--code-muted); background: var(--code-bg-alt); }
.tool-workspace .op-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.tool-workspace .op-btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.tool-workspace .code-editor { background: var(--code-bg); }
/* 代码区内的失败候选面板：沿用浅色卡片语义色 */
.tool-workspace .fail-panel { background: var(--bg-subtle); border-color: var(--border); color: var(--text-body); }
/* 面板内未显式设色的文本（如反编译结果 pre）统一继承工作区正文色 */
.tool-workspace .tool-panel { color: var(--code-text); }

/* 反编译两页的包树 / 源码区跟随工作区主题（样式写在模板内联 <style>，这里按优先级覆盖） */
.tool-workspace .pkg-filter { border-bottom-color: var(--code-btn-border); }
.tool-workspace .pkg-filter input {
    background: var(--code-bg-alt); border-color: var(--code-btn-border); color: var(--code-text);
}
.tool-workspace .pkg-filter input::placeholder { color: var(--code-muted); }
.tool-workspace .pkg-filter input:focus { border-color: var(--code-accent); }
.tool-workspace .pkg-node { color: var(--code-text); }
.tool-workspace .pkg-node::before {
    background-image: repeating-linear-gradient(to right, rgba(0,0,0,.10) 0 1px, transparent 1px 16px);
}
.tool-workspace .pkg-node:hover { background: var(--surface-hover); }
.tool-workspace .pkg-node .pkg-arrow,
.tool-workspace .pkg-node .pkg-count,
.tool-workspace .pkg-empty { color: var(--code-muted); }
.tool-workspace .pkg-node.is-class.active { background: rgba(38,117,191,.10); color: var(--code-accent); }
.tool-workspace .pkg-gutter {
    background: var(--code-gutter-bg); border-right-color: var(--code-border); color: var(--code-muted);
}
.tool-workspace .pkg-source-body { color: var(--code-text); }
/* github-dark 主题已从反编译页移除，这里按 IntelliJ Light 定义 token 色 */
.tool-workspace .pkg-source-body.hljs { background: var(--code-bg); color: var(--code-text); }
/* highlight.js token → IntelliJ Light */
.tool-workspace .hljs-keyword,
.tool-workspace .hljs-doctag,
.tool-workspace .hljs-meta .hljs-keyword,
.tool-workspace .hljs-selector-tag,
.tool-workspace .hljs-literal,
.tool-workspace .hljs-section,
.tool-workspace .hljs-link { color: var(--code-kw); }
.tool-workspace .hljs-string,
.tool-workspace .hljs-meta .hljs-string,
.tool-workspace .hljs-title,
.tool-workspace .hljs-title.class_,
.tool-workspace .hljs-title.function_,
.tool-workspace .hljs-name,
.tool-workspace .hljs-type,
.tool-workspace .hljs-attribute,
.tool-workspace .hljs-attr,
.tool-workspace .hljs-symbol,
.tool-workspace .hljs-bullet,
.tool-workspace .hljs-variable,
.tool-workspace .hljs-template-tag,
.tool-workspace .hljs-template-variable,
.tool-workspace .hljs-selector-attr,
.tool-workspace .hljs-selector-class,
.tool-workspace .hljs-selector-id,
.tool-workspace .hljs-selector-pseudo { color: var(--code-str); }
.tool-workspace .hljs-number,
.tool-workspace .hljs-regexp,
.tool-workspace .hljs-built_in,
.tool-workspace .hljs-builtin-name,
.tool-workspace .hljs-params,
.tool-workspace .hljs-operator { color: var(--code-num); }
.tool-workspace .hljs-comment,
.tool-workspace .hljs-quote,
.tool-workspace .hljs-meta,
.tool-workspace .hljs-code,
.tool-workspace .hljs-formula { color: var(--code-muted); }
.tool-workspace .hljs-subst,
.tool-workspace .hljs-emphasis,
.tool-workspace .hljs-strong { color: var(--code-text); }
.tool-workspace .hljs-addition { color: var(--code-success); background: transparent; }
.tool-workspace .hljs-deletion { color: var(--code-danger); background: transparent; }
/* 面板底部提示条 / 字符数 / 快捷键提示：沿用深色次级色 */
.tool-workspace .tool-panel-foot { border-top-color: var(--code-border); color: var(--code-muted); }
.tool-workspace .input-hint { color: var(--code-muted); }

/* Base64 图片互转：拖拽区与棋盘预览跟随工作区浅色面板 */
.tool-workspace .b64-drop {
    background: var(--code-bg-alt); border-color: var(--code-btn-border); color: var(--code-muted);
}
.tool-workspace .b64-drop:hover,
.tool-workspace .b64-drop.over { background: var(--surface-hover); border-color: var(--code-accent); color: var(--code-accent); }
.tool-workspace .b64-preview {
    background: repeating-conic-gradient(#F2F2F2 0 25%, #E4E4E4 0 50%) 0 0/16px 16px;
    border-color: var(--code-border);
}
.tool-workspace .b64-preview .empty,
.tool-workspace .b64-info { color: var(--code-muted); }

/* JWT 解析：签名小标题与提示条改用浅色语义色 */
.tool-workspace .jwt-sig-label { color: var(--code-muted); }
.tool-workspace .jwt-notice-info { background: #EAF3FB; color: var(--code-text); }
.tool-workspace .jwt-notice-ok { background: #E6F4EA; color: var(--code-success); }
.tool-workspace .jwt-notice-warn { background: #FFF4E0; color: var(--code-warning); }
.tool-workspace .jwt-notice-expired,
.tool-workspace .jwt-notice-danger { background: #FDECEE; color: var(--code-danger); border-left-color: var(--code-danger); }

/* 面板内的表单控件（部分工具的选项行放在面板里） */
.tool-workspace .tool-panel input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
.tool-workspace .tool-panel select,
.tool-workspace .tool-panel .opt-input {
    background: var(--code-bg-alt); border-color: var(--code-btn-border); color: var(--code-text);
}
.tool-workspace .tool-panel input::placeholder { color: var(--code-muted); }
.tool-workspace .tool-panel input:focus,
.tool-workspace .tool-panel select:focus { border-color: var(--code-accent); outline: none; }
/* 分段控件 / 小胶囊 / 面板内标签页 */
.tool-workspace .tool-panel .seg { background: var(--code-bg-alt); border-color: var(--code-btn-border); }
.tool-workspace .tool-panel .seg button { color: var(--code-muted); }
.tool-workspace .tool-panel .seg button.active { background: var(--primary); color: #fff; }
.tool-workspace .ds-chip { background: var(--code-btn-bg); border-color: var(--code-btn-border); color: var(--code-text); }
.tool-workspace .ds-chip:hover { border-color: var(--code-accent); color: var(--code-accent); }
.tool-workspace .mapper-tab { background: var(--code-btn-bg); border-color: var(--code-btn-border); color: var(--code-muted); }
.tool-workspace .mapper-tab.active { background: var(--code-bg); color: var(--code-accent); border-color: var(--code-accent); }
/* 面板内的拖拽区 / 结果块 */
.tool-workspace .qr-wrap,
.tool-workspace .drop-zone,
.tool-workspace .svg-drop,
.tool-workspace .jtm-drop {
    background: var(--code-bg-alt); border-color: var(--code-btn-border); color: var(--code-muted);
}
.tool-workspace .jtm-drop:hover,
.tool-workspace .jtm-drop.on { background: var(--surface-hover); border-color: var(--code-accent); }
.tool-workspace .jtm-gradle-row { background: var(--code-bg-alt); border-color: var(--code-border); }
.tool-workspace .tool-panel pre { background: var(--code-bg-alt); color: var(--code-text); }




/* 包树手风琴（反编译工具）：桌面端摘要隐藏、内容常显；手机端折叠成可点开的手风琴 */
.pkg-tree-fold { min-width: 0; }
.pkg-tree-fold > .pkg-tree-summary { display: none; }
@media (max-width: 768px) {
    .pkg-tree-fold > .pkg-tree-summary {
        display: flex; align-items: center; justify-content: space-between; gap: 8px;
        padding: 12px 16px; cursor: pointer; list-style: none;
        background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card);
        font-size: 13px; font-weight: 600; color: var(--text-body);
    }
    .pkg-tree-fold > .pkg-tree-summary::-webkit-details-marker { display: none; }
    .pkg-tree-fold > .pkg-tree-summary::after { content: '▾'; font-size: 12px; color: var(--text-muted); }
    .pkg-tree-fold[open] > .pkg-tree-summary { margin-bottom: 8px; }
    .pkg-tree-fold[open] > .pkg-tree-summary::after { transform: rotate(180deg); }
}
/* 工具选项行内的下拉选择（缩进等），沿用工具栏尺寸 */
.tool-options select {
    padding: 4px 8px; border: 1px solid var(--border); border-radius: var(--radius-tag);
    background: var(--bg-card); color: var(--text-body); font-size: 13px; font-family: inherit; cursor: pointer;
}
/* 常用示例快捷标签（正则 / Cron 等工具） */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 14px; }
.preset-label { font-size: 13px; color: var(--text-muted); margin-right: 2px; }
.preset-chip {
    padding: 5px 12px; border: 1px solid var(--border); border-radius: var(--radius-tag);
    background: var(--surface); font-size: 13px; color: var(--text-body); cursor: pointer;
    transition: all .15s;
}
.preset-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--tag-bg); }
/* 工具详情页页头：与其它无面包屑页面的 page-head 顶距一致（20px） */
.tool-title-row { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
/* 标题行：H1 只放工具名，状态徽标作为同级元素同行显示，按文字基线对齐；
   gap 6 + 徽标自身 margin-left 6，合计 12px，与原先位于 H1 内时（空白符 + margin）保持一致 */
.tool-title-line { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.tool-title-line h1 { min-width: 0; }
.tool-title-row .tool-icon { width: 52px; height: 52px; font-size: 24px; }
.tool-seo { margin-top: 32px; background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card); padding: 24px; }
.tool-seo h2 { font-size: 18px; margin-bottom: 12px; }
.tool-seo p { font-size: 14px; color: var(--text-secondary); line-height: 1.9; margin-bottom: 8px; }
/* 说明区行内链接：全局 a 被重置为继承色，这里还原成一眼可辨的链接样式 */
.tool-seo a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(76,88,190,.45); transition: color .15s, text-decoration-color .15s; }
.tool-seo a:hover { color: var(--primary-dark); text-decoration-color: var(--primary-dark); }
/* 说明区行内代码：与文章正文保持一致，避免命令关键字和普通文字混在一起 */
.tool-seo code { font-family: Consolas, Monaco, monospace; font-size: 13px; background: var(--bg-subtle); padding: 2px 6px; border-radius: 4px; color: #c7254e; }
.tool-seo ol { margin: 0 0 8px; padding-left: 20px; font-size: 14px; line-height: 1.9; color: var(--text-secondary); }

/* 工具页容器：底部留白（替代模板内联 style） */
.tool-page { padding-bottom: 48px; }
/* 工具页内的隐藏元素：作者样式里的 display 会盖过 [hidden]，这里统一兜底 */
.tool-page [hidden] { display: none; }

/* 步骤条（粘贴 → 选源编码 → 转换），桌面横排、窄屏竖排 */
.steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 16px 0 0; }
.step {
    display: flex; align-items: center; gap: 10px; padding: 12px 14px;
    background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-card);
}
.step-no {
    width: 20px; height: 20px; border-radius: 50%; background: var(--tag-bg); color: var(--primary);
    font-size: 12px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
.step b { font-size: 13px; color: var(--text-title); }
.step i { font-style: normal; font-size: 11.5px; color: var(--text-muted); }

/* 分段控件（BOM 去除/保留/添加） */
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: var(--radius-pill); overflow: hidden; background: var(--surface); }
.seg button {
    border: 0; background: transparent; padding: 5px 12px; font-size: 12.5px;
    color: var(--text-secondary); cursor: pointer;
}
.seg button.active { background: var(--primary); color: #fff; }

/* 等宽分段器：四项以上、单行等分（如 Excel / CSV / JSON / XML）
   与 .seg 搭配使用，只覆盖本变体的外观，不影响 .seg 的既有页面 */
.seg.seg-equal {
    display: flex; width: 100%; max-width: 600px;
    padding: 3px; border-radius: 10px;
}
.seg.seg-equal button {
    flex: 1 1 0; min-width: 0; height: 30px; padding: 0 10px;
    border: 1px solid transparent; border-radius: 7px;
    font-size: 13px; text-align: center; white-space: nowrap;
    transition: color .15s, background .15s, border-color .15s;
}
.seg.seg-equal button:hover { color: var(--primary); background: var(--tag-bg); }
.seg.seg-equal button.active {
    background: var(--tag-bg); border-color: var(--primary);
    color: var(--primary); font-weight: 600;
}

/* 开关：可逆勾选（如「首行是表头」），勾选态主色填充 */
.switch {
    position: relative; display: inline-flex; align-items: center; gap: 9px;
    font-size: 12.5px; color: var(--text-secondary);
    cursor: pointer; user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
    position: relative; flex: none; width: 38px; height: 21px;
    border-radius: 999px; background: #d1d5db; transition: background .18s;
}
.switch-knob {
    position: absolute; top: 2px; left: 2px; width: 17px; height: 17px;
    border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(17, 24, 39, .25);
    transition: transform .18s;
}
.switch input:checked + .switch-track { background: var(--primary); }
.switch input:checked + .switch-track .switch-knob { transform: translateX(17px); }
.switch input:focus-visible + .switch-track { box-shadow: 0 0 0 3px rgba(76, 88, 190, .18); }
.switch.disabled { opacity: .45; cursor: not-allowed; }

/* 选项分组卡片：组标题在上、控件同排；多组时用 1px 竖线分隔 */
.tool-opt-groups {
    display: flex; align-items: stretch; gap: 22px; flex-wrap: wrap;
    margin-top: 14px; padding: 14px 18px;
    background: var(--bg-card); border: 1px solid var(--border-light); border-radius: var(--radius-card);
}
.tool-opt-group { display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.tool-opt-group-title { font-size: 11.5px; font-weight: 600; color: var(--text-muted); letter-spacing: .2px; }
.tool-opt-group-row {
    display: flex; align-items: center; gap: 18px; flex-wrap: wrap; min-height: 32px;
    font-size: 12.5px; color: var(--text-secondary);
}
.tool-opt-group-row label { display: inline-flex; align-items: center; gap: 7px; }
.tool-opt-group-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
/* 组内下拉：统一高度 + 自绘箭头，避免各工具重复写 */
.tool-opt-group-row select {
    appearance: none; -webkit-appearance: none;
    height: 32px; padding: 0 30px 0 10px;
    border: 1px solid var(--border); border-radius: 7px;
    background-color: var(--surface);
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%236b7280' stroke-width='1.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 9px center; background-size: 12px;
    color: var(--text-body); font-family: inherit; font-size: 12.5px;
    cursor: pointer; outline: none; transition: border-color .15s, box-shadow .15s;
}
.tool-opt-group-row select:hover { border-color: #cfd4dc; }
.tool-opt-group-row select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(76, 88, 190, .12); }
/* 组内数字输入：窄宽居中，去掉浏览器上下箭头 */
.tool-opt-group-row input[type="number"] {
    width: 66px; height: 32px; padding: 0 6px;
    border: 1px solid var(--border); border-radius: 7px; background: var(--surface);
    color: var(--text-body); font-family: inherit; font-size: 13px;
    text-align: center; outline: none; transition: border-color .15s, box-shadow .15s;
}
.tool-opt-group-row input[type="number"]:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(76, 88, 190, .12); }
.tool-opt-group-row input[type="number"]::-webkit-inner-spin-button,
.tool-opt-group-row input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* 示例文字链：次级色小号下划线，不和主按钮争视觉 */
.sample-link {
    border: 0; background: transparent; padding: 0 2px;
    color: var(--text-secondary); font-family: inherit; font-size: 12px;
    cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
    white-space: nowrap; transition: color .15s;
}
.sample-link:hover { color: var(--primary); }

@media (max-width: 640px) {
    .seg.seg-equal { overflow-x: auto; max-width: 100%; }
    .seg.seg-equal button { flex: 0 0 auto; padding: 0 16px; }
    .tool-opt-groups { flex-direction: column; gap: 14px; padding: 12px 14px; }
}

/* 方形图标按钮（交换源/目标编码） */
.btn-icon { width: 36px; height: 34px; padding: 0; display: inline-flex; align-items: center; justify-content: center; font-size: 15px; }

/* 只读输出框底色（不使用内联 style） */
.tool-panel textarea[readonly] { background: var(--bg); }

/* 面板头状态文字：单行省略，保证左右面板头等高、文本框 top 对齐 */
.tool-page .tool-panel-head .t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tool-page .tool-panel-head .ops { flex: 0 0 auto; }

/* 失败态候选面板（只在自动还原不干净时出现） */
.fail-panel {
    margin: 10px 16px 12px; padding: 10px 12px;
    background: var(--bg-subtle); border: 1px solid var(--border); border-radius: 10px;
}
.fail-title { font-size: 12.5px; color: var(--text-title); margin-bottom: 8px; }
.fail-row {
    display: flex; align-items: flex-start; gap: 10px; padding: 7px 10px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
}
.fail-row + .fail-row { margin-top: 6px; }
.fail-row.picked { border-color: var(--primary); background: var(--tag-bg); }
.fail-row.disabled { opacity: .65; }
.fail-note { display: block; margin-top: 2px; font-style: normal; font-size: 11.5px; color: var(--text-muted); }
.fail-name { flex: 0 0 auto; min-width: 92px; font-size: 12.5px; font-weight: 600; color: var(--text-title); }
.fail-preview {
    flex: 1 1 auto; min-width: 0; font-family: Consolas, Monaco, monospace; font-size: 12px;
    line-height: 1.55; color: var(--text-body); white-space: pre-wrap; word-break: break-all;
}
.fail-pick {
    flex: 0 0 auto; border: 1px solid var(--border); background: var(--surface); border-radius: 6px;
    padding: 3px 10px; font-size: 12px; color: var(--primary); cursor: pointer;
}
.fail-pick:hover { border-color: var(--primary); }

/* 说明区折叠块 */
.fold { border-top: 1px solid var(--border-light); padding: 10px 0; }
.fold:first-child { border-top: 0; padding-top: 0; }
.fold summary { font-size: 13px; color: var(--text-secondary); cursor: pointer; list-style: none; }
.fold summary::-webkit-details-marker { display: none; }
.fold summary::before { content: '▸ '; }
.fold[open] summary::before { content: '▾ '; }
.fold p { margin: 6px 0 0; }

@media (max-width: 768px) {
    .tool-panels, .steps { grid-template-columns: 1fr; }
    /* 编码/选项行改单列，交换按钮占满整行 */
    .tool-page .tool-options { flex-direction: column; align-items: stretch; }
    .tool-page .tool-options > .btn-icon { width: 100%; }
}

/* 旧版编辑器样式保留（兼容未迁移模板） */
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.editor-box { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card); overflow: hidden; }
.editor-header {
    padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border-light);
    display: flex; justify-content: space-between; align-items: center;
}
.editor-label { font-size: 13px; font-weight: 600; color: var(--text-body); }
.editor-textarea {
    width: 100%; height: 380px; padding: 14px; resize: none; outline: none;
    font-family: Consolas, Monaco, 'Courier New', monospace; font-size: 13px;
    line-height: 1.6; border: none; background: var(--bg);
}
.editor-output {
    width: 100%; height: 380px; padding: 14px; overflow-y: auto;
    font-family: Consolas, Monaco, 'Courier New', monospace; font-size: 13px;
    line-height: 1.6; background: var(--bg); white-space: pre-wrap;
}
.help-section { max-width: none; margin: 0 auto; padding: 0 var(--pad-x) 40px; }
.help-card { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card); padding: 22px; }
.help-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 14px; }
.help-card p { font-size: 14px; color: var(--text-body); line-height: 1.8; margin-bottom: 10px; }

/* ===== 选项 ===== */
.opt { font-size: 13px; color: var(--text-body); display: inline-flex; align-items: center; gap: 6px; }
.opt input { accent-color: var(--primary); }
.opt-input {
    padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-btn);
    font-size: 13px; outline: none;
}
.opt-input:focus { border-color: var(--primary); }

/* ===== 速查页 ===== */
/* 场景只作分组标题，命令条目本身是卡片，与全站卡片同一套圆角（12px）与间距 */
.scenario-group { margin-bottom: 28px; }
.scenario-header {
    padding: 0 0 12px; background: none; border: none;
    font-size: 16px; font-weight: 600; color: var(--text-title);
    /* 由 div 改为 h2 后显式归零外边距，避免浏览器默认标题间距改变视觉 */
    margin: 0;
}
/* 命令卡最小宽 520：1920 排 3 列、2560 排 4 列，语法行不易被挤断 */
.command-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(520px, 1fr)); gap: 14px; }
.command-item {
    padding: 16px 18px; background: var(--surface);
    border: 1px solid var(--border-light); border-radius: var(--radius-card);
    display: flex; justify-content: space-between; align-items: center; gap: 16px;
    transition: border-color .2s, box-shadow .2s, transform .2s;
}
.command-item:hover {
    border-color: var(--primary-light); box-shadow: 0 8px 20px rgba(76,88,190,.12);
    transform: translateY(-2px);
}
.command-title { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.command-syntax {
    font-family: Consolas, Monaco, 'Courier New', monospace; font-size: 13px;
    color: var(--text-secondary); background: var(--bg); padding: 6px 10px; border-radius: 6px;
    display: inline-block; word-break: break-all;
}
.command-copy {
    padding: 6px 16px; border-radius: 6px; font-size: 13px; flex-shrink: 0;
    background: var(--primary); color: #fff; border: none; cursor: pointer;
}
.command-copy:hover { background: var(--primary-light); }

/* 单条命令的补充说明（note 可空，配置了才渲染） */
.command-note {
    margin: 0 0 6px; font-size: 12.5px; line-height: 1.65;
    color: var(--text-muted);
}

/* 速查页导语：配置 intro 后替换固定副标题，最多 600 字 */
.tool-header .cheat-intro {
    max-width: 900px; font-size: 14px; line-height: 1.9;
    color: var(--text-secondary);
}

/* 速查页 Markdown 讲解区：复用 .article-body 排版，命令表之后整宽展示 */
.cheat-content { margin: 0 var(--pad-x); border-top: 1px solid var(--border); }

/* ===== 统一搜索框（速查目录 / 速查分类 / 工具 / 工具分类 / 文章 / 文章分类） ===== */
.dx-search { margin-bottom: 14px; }
.dx-search-box {
    display: flex; align-items: center; gap: 8px;
    width: 100%; max-width: 420px; height: 38px; padding: 0 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
    transition: border-color .2s, box-shadow .2s;
}
.dx-search-box:focus-within {
    border-color: var(--primary); box-shadow: 0 0 0 3px rgba(76,88,190,.13);
}
.dx-search-icon { width: 16px; height: 16px; flex: none; color: var(--text-muted); }
.dx-search-input {
    flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: none;
    background: transparent; font-family: inherit; font-size: 14px; color: var(--text-body);
}
.dx-search-input::placeholder { color: var(--text-muted); }
.dx-search-clear {
    flex: none; width: 20px; height: 20px; padding: 0; border: 0; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--bg-subtle); color: var(--text-secondary);
    font-size: 15px; line-height: 1; cursor: pointer;
}
.dx-search-clear:hover { background: var(--border); color: var(--text-body); }
.dx-search-clear[hidden] { display: none; }
/* 搜索按钮：贴在输入框容器右端，与输入框同一个圆角容器 */
.dx-search-submit {
    flex: none; height: 26px; padding: 0 10px;
    border: 0; border-radius: 6px;
    background: var(--primary); color: #fff;
    font-family: inherit; font-size: 13px; line-height: 1; cursor: pointer;
    transition: background .15s, opacity .15s;
}
.dx-search-submit:hover { background: #4a5ac8; }
.dx-search-submit:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dx-search-foot {
    display: flex; align-items: center; gap: 10px;
    min-height: 16px; margin-top: 6px;
    font-size: 12px; color: var(--text-muted);
}
.dx-search-empty[hidden] { display: none; }
/* 顶部搜索的筛选计数行：插在列表上方，样式沿用上面的提示行 */
.dx-filter-count { margin: 8px 0 10px; }
.dx-filter-count[hidden] { display: none; }
.dx-filter-count + .tool-grid,
.dx-filter-count + .article-list,
.dx-filter-count + .scenario-group { margin-top: 0; }
/* 搜索框与分类条、列表的间距保持一致 */
.dx-search + .tab-row { margin-top: 0; }
.tab-row + .tool-grid,
.tab-row + .article-list,
.tab-row + .scenario-group { margin-top: 14px; }
@media (max-width: 640px) {
    .dx-search-box { max-width: none; }
}

/* ===== 搜索联想下拉（站内词库，全站共用；不走浏览器原生补全） ===== */
.dx-suggest-panel {
    position: fixed; z-index: 800;
    padding: 6px; max-height: 380px; overflow-y: auto;
    background: var(--surface); border: 1px solid var(--border-light); border-radius: 10px;
    box-shadow: 0 8px 24px rgba(17,24,39,.12);
    /* 面板内滚到底时不连锁滚动页面，滚轮只作用在面板内部 */
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}
.dx-suggest-panel::-webkit-scrollbar { width: 8px; }
.dx-suggest-panel::-webkit-scrollbar-track { background: transparent; }
.dx-suggest-panel::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.dx-suggest-panel::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
.dx-suggest-panel[hidden] { display: none; }
.dx-suggest-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 10px; border-radius: 7px;
    font-size: 13px; line-height: 1.4; color: var(--text-body);
    white-space: nowrap; cursor: pointer;
}
/* hover 与键盘高亮同一套视觉 */
.dx-suggest-item.is-active { background: var(--bg-subtle); color: var(--text-title); }
.dx-suggest-icon { flex: none; width: 16px; text-align: center; font-size: 13px; }
.dx-suggest-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.dx-suggest-type {
    flex: none; padding: 1px 7px; border-radius: var(--radius-tag);
    background: var(--tag-bg); color: var(--text-muted); font-size: 11px;
}
.dx-suggest-item.is-active .dx-suggest-type { color: var(--primary); }
/* 分组小标题：灰色小字，紧凑，不抢条目视觉 */
.dx-suggest-group-title {
    padding: 6px 10px 2px;
    font-size: 11px; line-height: 1.4; font-weight: 500;
    color: var(--text-muted);
}
.dx-suggest-group-title:not(:first-child) {
    border-top: 1px solid var(--border-light);
    margin-top: 4px; padding-top: 8px;
}
@media (max-width: 640px) {
    .dx-suggest-panel { max-height: 380px; }
}

/* 速查分组 Tab：移动端单行横向滚动、隐藏滚动条，不换行（桌面端与工具页一致自动换行） */
@media (max-width: 768px) {
    .tab-row--scroll {
        flex-wrap: nowrap; overflow-x: auto; overflow-y: hidden;
        -webkit-overflow-scrolling: touch; scrollbar-width: none;
    }
    .tab-row--scroll::-webkit-scrollbar { display: none; }
    .tab-row--scroll .tab-chip { flex: 0 0 auto; }
}

.cs-empty {
    text-align: center; color: var(--text-muted); font-size: 14px; padding: 40px 0;
}

/* ===== 下载页（对齐原型 DT-P09） ===== */
.download-hero { background: var(--gradient-bg); padding: 56px 16px 64px; text-align: center; position: relative; overflow: hidden; }
.download-hero::before { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; background: rgba(76,88,190,.08); top: -160px; right: -80px; }
.download-hero-inner { position: relative; z-index: 1; max-width: 680px; margin: 0 auto; }
.download-card {
    max-width: 640px; margin: 32px auto 0; background: var(--surface); border-radius: 16px;
    box-shadow: 0 12px 40px rgba(76,88,190,.15); padding: 32px; text-align: center;
    border: 1px solid var(--border-light);
}
.download-card .version-tag { display: inline-block; padding: 3px 12px; border-radius: 999px; background: var(--tag-bg); color: var(--primary); font-size: 12px; font-weight: 600; }
.download-btn {
    display: inline-flex; align-items: center; gap: 8px; margin-top: 20px;
    padding: 14px 40px; border-radius: 10px; background: var(--gradient); color: #fff;
    font-size: 16px; font-weight: 600; border: none; cursor: pointer; transition: all .2s;
    box-shadow: 0 4px 14px rgba(76,88,190,.35);
}
.download-btn:hover:not(:disabled) { box-shadow: 0 8px 24px rgba(76,88,190,.5); transform: translateY(-2px); }
.download-btn:disabled { opacity: .6; cursor: not-allowed; }
.download-meta { margin-top: 14px; font-size: 12px; color: var(--text-muted); }
.safety-bar {
    margin-top: 16px; padding: 10px; background: #f6ffed; border: 1px solid #b7eb8f;
    border-radius: 8px; font-size: 12px; color: #52c41a;
}
.feature-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 24px; }
.feature-item { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card); padding: 20px; display: flex; gap: 14px; }
.feature-item .icon { width: 42px; height: 42px; border-radius: 10px; background: var(--tag-bg); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.feature-item .t { font-size: 15px; font-weight: 600; }
.feature-item .d { font-size: 13px; color: var(--text-secondary); margin-top: 4px; line-height: 1.6; }
.compare-table { width: 100%; border-collapse: collapse; background: var(--surface); border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,.06); margin-top: 24px; }
.compare-table th, .compare-table td { padding: 14px 20px; text-align: center; border-bottom: 1px solid var(--border-light); font-size: 14px; }
.compare-table th { background: var(--bg); font-weight: 600; }
.compare-table td:first-child, .compare-table th:first-child { text-align: left; }
.compare-table .ok { color: var(--success); font-weight: 700; }
.compare-table .no { color: var(--text-muted); }
.compare-table .pro-col { background: linear-gradient(180deg, #f6f4fe, #fff); }
.promise-bar { display: flex; gap: 16px; margin-top: 20px; justify-content: center; flex-wrap: wrap; }
.promise-item { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-secondary); }
.promise-item .icon { color: var(--primary); font-size: 16px; }
.roadmap { display: flex; gap: 12px; margin-top: 20px; justify-content: center; flex-wrap: wrap; }
.roadmap-item {
    background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card);
    padding: 16px 20px; min-width: 180px; text-align: center;
}
.roadmap-item.current { border-color: var(--primary); background: var(--tag-bg); }
.roadmap-item .v { font-size: 13px; font-weight: 700; color: var(--primary); }
.roadmap-item .t { font-size: 12px; color: var(--text-secondary); margin-top: 4px; }
.roadmap-item .st { font-size: 11px; margin-top: 6px; }
.st.done { color: var(--success); }
.st.doing { color: var(--warning); }
.st.plan { color: var(--text-muted); }

/* ===== 文章列表 ===== */
/* 自动填充：宽屏多列、窄屏自动退成单列；卡片统一竖向排列（封面在上，正文在下） */
.article-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; margin-top: 16px; }
.article-card {
    display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--surface);
    border: 1px solid var(--border-light); border-radius: var(--radius-card);
    transition: all .2s;
}
.article-card:hover { border-color: var(--primary-light); box-shadow: 0 8px 20px rgba(76,88,190,.12); transform: translateY(-2px); }
.article-cover {
    position: relative; overflow: hidden;
    /* 满宽封面 + 16:9，宽度随卡片自适应，不再固定 176px */
    width: 100%; aspect-ratio: 16 / 9; height: auto; align-self: stretch;
    border-radius: 8px; background: var(--bg-subtle);
    display: flex; align-items: center; justify-content: center; font-size: 32px; flex-shrink: 0;
}
/* 按文章分类着色，作为封面主色（无需上传图片也有完整视觉效果） */
/* 无封面占位块：列表页与首页共用同一 fragment，尺寸由父容器决定 */
.cover-ph { position: relative; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.cover-ph .cover-icon { font-size: 42px; line-height: 1; filter: drop-shadow(0 3px 8px rgba(0, 0, 0, .18)); position: relative; z-index: 1; }
.cover-ph .cover-label {
    position: absolute; left: 12px; bottom: 10px; z-index: 1;
    font-size: 12px; font-weight: 600; letter-spacing: 1px; opacity: .85;
}
.cover-ph::after {
    content: ''; position: absolute; width: 130px; height: 130px; border-radius: 50%;
    background: rgba(255, 255, 255, .35); right: -46px; top: -46px;
}
.cover-pitfall { background: linear-gradient(135deg, #fff2f0 0%, #ffd9d4 100%); color: #c0392b; }
.cover-solution { background: linear-gradient(135deg, #eff2ff 0%, #d8ddff 100%); color: #4a56c9; }
.cover-tips { background: linear-gradient(135deg, #ecfdf3 0%, #c9f5dd 100%); color: #0f8a55; }
.cover-default { background: linear-gradient(135deg, #f4f5f9 0%, #e3e6f0 100%); color: #6b7280; }
/* 有封面时占位块隐藏；封面为空或加载失败时才显示占位，二者不会同时出现 */
.cover-placeholder { position: absolute; inset: 0; }
.cover-placeholder.is-hidden { display: none; }
.article-cover .cover-photo-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.article-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.article-title { font-size: 16px; font-weight: 600; line-height: 1.4; }
.article-title:hover { color: var(--primary); }
.article-summary { margin-top: 6px; font-size: 13px; color: var(--text-secondary); line-height: 1.7; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 标题行数不同时，分类与日期始终贴齐卡片底部 */
.article-meta { margin-top: auto; padding-top: 10px; display: flex; align-items: center; gap: 16px; font-size: 12px; color: var(--text-muted); }
.article-category { display: inline-block; padding: 2px 10px; border-radius: var(--radius-tag); background: var(--tag-bg); color: var(--primary); font-size: 12px; }
/* 首页「最新文章」沿用同一套卡片，--grid 仅作语义标记，列数交给 auto-fill */
.article-list--grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
/* 摘要固定两行高度：短摘要也占满两行，同行卡片高度一致（截断规则沿用列表页） */
.article-list--grid .article-summary { min-height: calc(1.7em * 2); }

/* ===== 文章卡片列表（/blog 与 /blog/category）===== */
.article-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.article-card-h {
    display: flex; gap: 20px; padding: 20px; background: var(--surface);
    border: 1px solid var(--border-light); border-radius: 12px;
    transition: border-color .18s, box-shadow .18s;
}
.article-card-h:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 14%, transparent);
}
.article-card-thumb {
    position: relative; width: 120px; height: 96px; flex-shrink: 0;
    border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-subtle); color: var(--text-secondary);
}
.article-card-thumb svg { width: 32px; height: 32px; }
.article-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* 分类占位浅底：由现有语义变量混出，跟随主题变量变化 */
.article-card-thumb.thumb-pitfall { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); color: var(--danger); }
.article-card-thumb.thumb-tips { background: color-mix(in srgb, var(--success) 10%, var(--surface)); color: var(--success); }
.article-card-thumb.thumb-solution { background: color-mix(in srgb, var(--primary) 8%, var(--surface)); color: var(--primary); }
.article-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.article-card-title { font-size: 17px; font-weight: 600; line-height: 1.4; color: var(--text-title); }
.article-card-h:hover .article-card-title { color: var(--primary); }
.article-card-summary {
    margin-top: 8px; font-size: 13.5px; line-height: 1.7; color: var(--text-secondary);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.article-card-meta {
    margin-top: auto; padding-top: 12px;
    display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
    font-size: 12px; color: var(--text-muted);
}
@media (max-width: 768px) {
    .article-card-h { gap: 14px; padding: 16px; }
    .article-card-thumb { width: 88px; height: 72px; }
    .article-card-thumb svg { width: 26px; height: 26px; }
    .article-card-title { font-size: 16px; }
}
@media (max-width: 480px) {
    .article-card-thumb { display: none; }
    .article-card-summary { -webkit-line-clamp: 1; }
}

/* ===== 列表分页：方形页码 + 右侧「下一页 →」 ===== */
.blog-pager { display: flex; align-items: center; gap: 8px; margin-top: 32px; }
.blog-pager-nums { display: flex; gap: 8px; flex-wrap: wrap; }
.blog-page-btn {
    min-width: 38px; height: 38px; padding: 0 10px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
    font-size: 14px; color: var(--text-body);
    transition: border-color .15s, color .15s, background .15s;
}
.blog-page-btn:hover { border-color: var(--primary); color: var(--primary); }
.blog-page-btn.active {
    background: var(--primary); border-color: var(--primary);
    color: var(--surface); font-weight: 600;
}
.blog-pager-next {
    margin-left: auto; height: 38px; padding: 0 14px;
    display: inline-flex; align-items: center; border-radius: 6px;
    font-size: 14px; color: var(--primary);
}
.blog-pager-next:hover { background: var(--tag-bg); }
.blog-pager-next.is-disabled { color: var(--text-muted); pointer-events: none; }
.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.page-btn {
    min-width: 36px; height: 36px; padding: 0 10px; border: 1px solid var(--border);
    border-radius: 6px; display: flex; align-items: center; justify-content: center;
    font-size: 14px; color: var(--text-body); cursor: pointer; background: var(--surface);
}
.page-btn:hover { border-color: var(--primary); color: var(--primary); }
.page-btn.active { border-color: var(--primary); color: var(--primary); background: var(--tag-bg); }

/* ===== 文章详情 ===== */
/* min-width:0 必须加：否则 grid item 的隐式 min-width:auto 会被长代码块/长表格撑开，
   导致正文溢出轨道压住右侧目录（桌面），或在移动端超出视口被裁切 */
.article-detail { min-width: 0; }
/* 单列布局（无右栏时 article-detail 是唯一子元素）：同样只受相对上限约束 */
.article-layout > .article-detail:only-child { max-width: 64em; margin: 0 auto; }

/* 文章页栅格：与底部「相关文章/相关速查」共用同一容器宽度（.container 内容宽），
   正文与右栏按比例分，不再按屏幕分档写死像素；唯一硬约束是正文可读性上限。 */
.article-layout {
    display: grid; gap: clamp(24px, 3vw, 48px); align-items: start;
    width: 100%;
    grid-template-columns: minmax(0, 1fr) clamp(240px, 18vw, 320px);
}
.article-layout--single { grid-template-columns: minmax(0, 1fr); }

/* 可读性上限：64em（正文 15px 时约 960px，约 64 个汉字/行）。
   超宽屏下生效，正文在自己的轨道内居中，右栏仍贴齐容器右边缘。 */
.article-layout .article-body {
    max-width: 64em; margin-inline: auto;
}

/* 小屏：右栏落到正文下方，只保留这一条断点 */
@media (max-width: 1099px) {
    .article-layout { grid-template-columns: minmax(0, 1fr); gap: 24px; }
    .article-sidebar { position: static; }
}

/* 右栏：目录 + 相关工具，吸顶跟随 */
.article-sidebar { display: flex; flex-direction: column; gap: 16px; }
.article-rail-block {
    background: var(--surface); border: 1px solid var(--border-light);
    border-radius: var(--radius-card); padding: 18px 20px;
}
.article-rail-title { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--text-title); }
.article-rail-link {
    display: block; padding: 6px 0; font-size: 13px; line-height: 1.5;
    color: var(--text-secondary); border-bottom: 1px dashed var(--border-light);
}
.article-rail-link:last-child { border-bottom: none; }
.article-rail-link:hover { color: var(--primary); }
.article-header { padding: 32px 0 24px; border-bottom: 1px solid var(--border-light); }
.article-header h1 { font-size: 28px; font-weight: 700; line-height: 1.4; }
.article-header .meta { margin-top: 12px; display: flex; align-items: center; gap: 16px; font-size: 13px; color: var(--text-muted); }
.article-body { padding: 32px 0; font-size: 15px; line-height: 1.9; color: var(--text-body); }
/* 正文链接：主色 + 半透明下划线，长段落中一眼可辨；hover 加深 */
.article-body a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(76,88,190,.45); transition: color .15s, text-decoration-color .15s; }
.article-body a:hover { color: var(--primary-dark); text-decoration-color: var(--primary-dark); }
.article-body h2 { font-size: 20px; font-weight: 600; margin: 32px 0 16px; color: var(--text-title); }
.article-body h3 { font-size: 17px; font-weight: 600; margin: 24px 0 12px; color: var(--text-title); }
.article-body p { margin-bottom: 16px; }
.article-body pre {
    background: var(--snippet-bg); color: var(--snippet-text);
    border: 1px solid var(--snippet-border);
    padding: 16px 20px; border-radius: 8px;
    overflow-x: auto; font-family: Consolas, Monaco, monospace; font-size: 13px; line-height: 1.7;
    margin: 16px 0; max-width: 100%;
}
/* 行内代码：色值/内边距/圆角对齐后台预览 .preview-pane code，红色文字 + 浅灰底 */
.article-body code { font-family: Consolas, Monaco, monospace; font-size: 13px; background: var(--bg-subtle); padding: 2px 6px; border-radius: 4px; color: #c7254e; }
/* pre 内代码沿用代码块前景色（深底浅字），避免整块被行内 code 规则染红 */
.article-body pre code { background: none; padding: 0; color: inherit; }
.article-body blockquote {
    border-left: 4px solid var(--primary); padding: 12px 20px; margin: 16px 0;
    background: var(--tag-bg); color: var(--text-secondary); border-radius: 0 8px 8px 0;
}
.article-body ul, .article-body ol { margin: 16px 0; padding-left: 24px; }
.article-body li { margin-bottom: 8px; }
/* 文章内表格（GFM） */
.article-body table { border-collapse: collapse; width: 100%; margin: 16px 0; font-size: 14px; display: block; overflow-x: auto; max-width: 100%; }
.article-body th, .article-body td { border: 1px solid var(--border); padding: 8px 12px; text-align: left; }
.article-body th { background: var(--bg-subtle); font-weight: 600; }
.article-body tr:nth-child(even) td { background: #fafbfc; }

/* 速查正文里的对照表：与工具页说明区共用一套 .seo-table 规则 */
.seo-table-wrap { overflow-x: auto; margin: 10px 0 12px; -webkit-overflow-scrolling: touch; }
.seo-table { width: 100%; min-width: 560px; border-collapse: collapse; font-size: 13.5px; }
.seo-table th,
.seo-table td {
    padding: 9px 12px; text-align: left; vertical-align: top;
    line-height: 1.7; border-bottom: 1px solid var(--border-light);
}
.seo-table th { background: var(--bg-subtle); color: var(--text-title); font-weight: 600; white-space: nowrap; }
.seo-table td { color: var(--text-secondary); }
.seo-table td:first-child { color: var(--text-body); font-weight: 600; white-space: nowrap; }
.seo-table tbody tr:last-child td { border-bottom: none; }
.seo-table code { white-space: normal; overflow-wrap: anywhere; }
/* 覆盖文章正文表格的块级滚动与斑马纹，避免与 seo 表格样式冲突 */
.article-body .seo-table { display: table; width: 100%; margin: 0; }
.article-body .seo-table th,
.article-body .seo-table td { border-left: none; border-right: none; border-top: none; }
.article-body .seo-table tr:nth-child(even) td { background: transparent; }
@media (max-width: 480px) {
    .seo-table { font-size: 13px; }
}
/* 文章内图片（截图 / 示意图）：居中、限制宽度、带描边与阴影 */
.article-body img {
    display: block; max-width: 100%; height: auto; margin: 20px auto;
    border: 1px solid var(--border-light); border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .06);
}
.article-sidebar { position: sticky; top: 80px; min-width: 0; }
.article-sidebar .toc { background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--radius-card); padding: 20px; max-height: calc(100vh - 110px); overflow-y: auto; }
.article-sidebar .toc-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.article-sidebar .toc-item { font-size: 13px; color: var(--text-secondary); padding: 6px 0; display: block; line-height: 1.5; }
.article-sidebar .toc-item.toc-sub { padding-left: 16px; font-size: 12.5px; color: var(--text-muted); }
.article-sidebar .toc-item:hover { color: var(--primary); }
.article-sidebar .toc-item.active { color: var(--primary); font-weight: 600; }
/* 锚点跳转时预留顶部导航高度，避免标题被遮挡 */
.article-body h2, .article-body h3 { scroll-margin-top: 76px; }

/* 相关文章推荐（文章详情页底部） */
.related-articles { margin-top: 48px; padding-top: 28px; border-top: 1px solid var(--border-light); }
.related-title { font-size: 17px; font-weight: 600; color: var(--text-title); margin-bottom: 16px; }
.related-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.related-card { display: block; border: 1px solid var(--border-light); border-radius: 10px; padding: 16px 18px; background: var(--surface); transition: border-color .15s, box-shadow .15s, transform .15s; }
.related-card:hover { border-color: var(--primary-light); box-shadow: 0 4px 16px rgba(76,88,190,.08); transform: translateY(-2px); }
.related-card-title { font-size: 14px; font-weight: 600; color: var(--text-title); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.related-card:hover .related-card-title { color: var(--primary); }
.related-card-meta { margin-top: 10px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); }
/* 窄屏关联卡片：单列排列 */
@media (max-width: 768px) {
    .related-grid { grid-template-columns: 1fr; }
    /* 速查命令卡：≤768 强制单列，避免最小宽 520 在手机上撑出横向滚动 */
    .command-list { grid-template-columns: 1fr; }
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
    /* 顶距统一由 --breadcrumb-gap 控制（移动端 20px） */
    .tool-title-row { margin-top: 24px; }
    .editor-grid { grid-template-columns: 1fr; }
    .feature-grid { grid-template-columns: 1fr; }
    .article-card { flex-direction: column; }
    .article-cover { width: 100%; aspect-ratio: 16 / 9; height: auto; align-self: stretch; }

    /* 博客详情：双栏改单栏，目录移到正文下方（覆盖模板内联 grid 样式） */
    .article-layout { grid-template-columns: minmax(0, 1fr) !important; gap: 24px !important; }
    .article-sidebar { position: static; }
    .article-sidebar .toc { max-height: none; }
    .article-header h1 { font-size: 22px; }
    .article-body { padding: 24px 0; font-size: 14.5px; }

    /* 速查页：命令代码块横向滚动，避免长命令被硬断行。
       grid / flex 子项默认 min-width:auto，会被 white-space:pre 的长命令撑宽，
       代码块拿不到可滚动宽度、卡片超出后被 body 的 overflow-x 裁掉（表现为命令显示不全）；
       所以这里逐层放开 min-width，并让代码块最多占满卡片内容宽。 */
    .command-list { grid-template-columns: minmax(0, 1fr); }
    .command-item { min-width: 0; }
    .command-desc { min-width: 0; flex: 1 1 auto; }
    .command-syntax {
        display: block; max-width: 100%;
        white-space: pre; word-break: normal; overflow-x: auto;
    }

    /* 正文行内代码：长 URL、长参数在移动端不撑破正文宽度 */
    .article-body code { overflow-wrap: anywhere; }

    /* 下载页：对比表横向滚动 */
    .compare-table { display: block; overflow-x: auto; }
    .compare-table th, .compare-table td { white-space: nowrap; }
}

@media (max-width: 480px) {
    .download-card { padding: 24px 20px; }
}

/* ===== 工具页多字段工作区（jwt-signer 引入，2026-11-05） ===== */
/* 参数行通栏 + 输入/输出双栏；768 以下顺序为输入 → 参数 → 输出 */
.tool-flow { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.tool-flow-params { grid-column: 1 / -1; margin-top: 0; }
.tool-flow-in { grid-column: 1; }
.tool-flow-out { grid-column: 2; display: flex; flex-direction: column; }
/* 多字段面板内容区：标签行 + 可编辑字段，纵向排布 */
.tool-panel-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }
.field-label {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; margin: 10px 0 6px; font-size: 12.5px; color: var(--text-secondary);
}
.field-label:first-child { margin-top: 0; }
.field-label .hint { font-size: 11.5px; color: var(--text-muted); }
/* 面板内可编辑字段：等宽、可纵向拖拽；主输入用 .tall 提到 320px */
.tool-panel textarea.field-input { min-height: 160px; font-size: 12.5px; }
.tool-panel textarea.field-input.tall { min-height: 320px; }
/* 只读结果框撑满面板剩余高度 */
.tool-panel textarea.fill { flex: 1 1 auto; min-height: 320px; }
.tool-panel-foot { margin-top: auto; padding: 10px 16px; border-top: 1px solid var(--border-light); font-size: 12px; color: var(--text-muted); }
/* 状态文字：成功/失败 */
.status-ok { color: var(--success); }
.status-bad { color: var(--danger); }
/* 面板头 .t 的选择器优先级更高，这里显式让状态色生效（只加颜色，不改布局） */
.tool-panel-head .t.status-ok { color: var(--success); }
.tool-panel-head .t.status-bad { color: var(--danger); }
@media (max-width: 768px) {
    .tool-flow { grid-template-columns: 1fr; }
    .tool-flow-in { grid-column: 1; grid-row: 1; }
    .tool-flow-params { grid-column: 1; grid-row: 2; }
    .tool-flow-out { grid-column: 1; grid-row: 3; }
}

/* ===== 共用确认弹框（配合 /js/dialog.js，独立区块） ===== */
.dlg-overlay {
    position: fixed; inset: 0; z-index: 2000; display: flex;
    align-items: center; justify-content: center; padding: 20px;
    background: rgba(17, 24, 39, .45);
}
.dlg-modal {
    width: 100%; max-width: 440px; background: var(--bg-card);
    border-radius: var(--radius-card); padding: 22px;
    box-shadow: 0 16px 40px rgba(17, 24, 39, .22);
}
.dlg-title { font-size: 17px; font-weight: 600; color: var(--text-title); }
.dlg-message {
    margin-top: 10px; font-size: 14px; line-height: 1.8;
    color: var(--text-secondary); white-space: pre-line;
}
.dlg-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }
.dlg-btn {
    min-height: 44px; padding: 0 18px; border: 1px solid var(--border);
    border-radius: var(--radius-btn); background: var(--bg-card);
    color: var(--text-title); font-size: 14px; font-family: inherit; cursor: pointer;
}
.dlg-btn:hover { border-color: var(--text-muted); }
.dlg-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.dlg-btn.dlg-primary { border-color: var(--primary); background: var(--primary); color: var(--bg-card); }
.dlg-btn.dlg-danger { border-color: var(--danger); background: var(--danger); color: var(--bg-card); }
.dlg-inline {
    display: flex; flex-direction: column; gap: 10px;
    margin-bottom: 12px; padding: 12px 14px;
    border: 1px solid var(--border); border-left: 4px solid var(--primary);
    border-radius: var(--radius-btn); background: var(--bg-subtle);
}
.dlg-inline-title { font-size: 14px; font-weight: 600; color: var(--text-title); }
.dlg-inline-msg { margin-top: 4px; font-size: 12.5px; line-height: 1.7; color: var(--text-secondary); }
.dlg-inline-actions { display: flex; justify-content: flex-end; gap: 8px; }
@media (max-width: 768px) {
    .dlg-overlay { align-items: flex-end; padding: 0; }
    .dlg-modal { max-width: none; border-radius: var(--radius-card) var(--radius-card) 0 0; }
    .dlg-actions { flex-direction: column-reverse; }
    .dlg-actions .dlg-btn { width: 100%; }
    .dlg-inline-actions .dlg-btn { flex: 1; }
}

/* ============================================================
   工具页说明区公共层（所有工具页复用）
   来源：needs/02-工具/json-formatter/prototype/seo.css（R2 定稿）
   取值仅使用 design-system.css 的 token，无写死色值
   ============================================================ */
.seo-lead { font-size: 14px; line-height: 1.9; color: var(--text-secondary); margin-bottom: 16px; }
.seo-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.seo-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-btn);
    padding: 12px 14px;
    align-self: start;
}
.seo-card.is-wide { grid-column: 1 / -1; }
/* 卡片标题常驻：作为 summary 时可折叠，作为普通标题时加 .is-static */
.seo-card-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 600; color: var(--text-title);
    cursor: pointer; list-style: none; border-radius: var(--radius-tag);
}
.seo-card-title::-webkit-details-marker { display: none; }
.seo-card-title::before {
    content: ''; width: 3px; height: 12px; border-radius: 2px;
    background: var(--primary); flex: 0 0 auto;
}
.seo-card-title:hover .seo-card-tt { color: var(--primary); }
.seo-card-title:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.seo-card-title.is-static { cursor: default; }
.seo-card-title.is-static:hover .seo-card-tt { color: var(--text-title); }
.seo-card-tt { flex: 1; min-width: 0; }
.seo-card-body { padding-top: 8px; }
.seo-card-body p { font-size: 13.5px; line-height: 1.8; color: var(--text-secondary); }
.seo-card-body p + p { margin-top: 8px; }

/* ---------- FAQ 折叠区：+ / − 图标、hover 与展开态差异必须保留 ---------- */
.seo-faq { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border-light); }
.seo-faq-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.seo-faq-head h3 { font-size: 15px; color: var(--text-title); }
.seo-faq-count { flex: 1; font-size: 12px; color: var(--text-muted); }
.faq-all {
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--bg-card); color: var(--text-secondary);
    font-size: 12px; font-family: inherit; padding: 5px 12px; cursor: pointer;
}
.faq-all:hover { border-color: var(--primary); color: var(--primary); }
.faq-all:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; }
.faq-item { border-bottom: 1px solid var(--border-light); }
.faq-q {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 11px 10px; font-size: 13.5px; line-height: 1.6; color: var(--text-body);
    cursor: pointer; list-style: none; border-radius: var(--radius-btn);
}
.faq-q::-webkit-details-marker { display: none; }

.faq-q:hover { background: var(--bg-subtle); color: var(--text-title); }
.faq-q:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.faq-qt { min-width: 0; }
.faq-ic {
    flex: 0 0 auto; width: 20px; height: 20px; display: inline-flex;
    align-items: center; justify-content: center; font-size: 13px; line-height: 1;
    color: var(--primary); border: 1px solid transparent; border-radius: var(--radius-pill);
    background: var(--tag-bg); transition: background .15s, color .15s, border-color .15s;
}
.faq-ic::before { content: '+'; }
.faq-q:hover .faq-ic { border-color: var(--primary); }
.faq-item[open] .faq-ic { color: var(--bg-card); border-color: var(--primary); background: var(--primary); }
.faq-item[open] .faq-ic::before { content: '−'; }
.faq-item[open] .faq-q { color: var(--text-title); font-weight: 600; }
.faq-a { padding: 0 10px 12px; }
.faq-a p { font-size: 13px; line-height: 1.85; color: var(--text-secondary); }

/* ---------- 相关文章：竖排，一行一条，整行可点 ---------- */
.rel { margin-top: 16px; }
.rel-title { font-size: 13px; font-weight: 600; color: var(--text-body); margin-bottom: 6px; }
.rel-item {
    display: block; padding: 8px 10px; border-radius: var(--radius-btn);
    font-size: 13px; line-height: 1.6; color: var(--primary);
    text-decoration: underline; text-underline-offset: 3px;
    transition: background .15s, color .15s;
}
.rel-item + .rel-item { margin-top: 2px; }
.rel-item:hover { background: var(--bg-subtle); color: var(--primary-dark); }
.rel-item:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.rel-arrow { color: var(--text-muted); margin-right: 6px; }

/* 输入区快捷键提示 */
.input-hint { margin: 6px 2px 0; font-size: 12px; line-height: 1.6; color: var(--text-muted); }

@media (max-width: 768px) {
    .seo-grid, .faq-list { grid-template-columns: 1fr; }
    .rel-item { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ============================================================
   统一数据来源组件（DataSource）
   规格：needs/00-总纲/design/数据来源组件-规格-2026-11-08.md
   仅使用 design-system.css 的 token，无写死色值
   ============================================================ */
.ds-panel { position: relative; }
/* 拖拽遮罩覆盖整个面板时，头部操作区保持可点 */
.ds-panel .tool-panel-head { position: relative; z-index: 6; }
.ds-extras {
    display: flex; flex-direction: column; gap: 8px;
    padding: 10px 16px 12px;
    border-top: 1px solid var(--border-light);
}
.ds-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    font-size: 12px; color: var(--text-muted);
}
.ds-row-label { flex: 0 0 auto; }
.ds-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.ds-chip {
    height: 24px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius-pill);
    background: var(--bg-card); color: var(--text-secondary);
    font-family: inherit; font-size: 12px; cursor: pointer;
}
.ds-chip:hover { border-color: var(--primary); color: var(--primary); background: var(--tag-bg); }
.ds-chip:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ds-chip-clear { color: var(--text-muted); }

/* ------------------------------------------------------------------
 * 筛选块统一规范（可复用）：新工具直接给元素加 class="filter-chip"
 * 未选中：白底 + 1px 描边 + 次级文字；选中：主色实心 + 白字
 * 语义色只作用于选中态：再加 .is-warn / .is-error
 * 页面只负责尺寸与排版，不再各自覆写选中/未选中配色
 * ------------------------------------------------------------------ */
.filter-chip,
.lp-chip,
.nl-chip {
    --fc-on-bg: var(--primary);
    --fc-on-fg: #fff;
    background: var(--fc-bg, var(--surface));
    border: 1px solid var(--fc-bd, var(--border));
    color: var(--fc-fg, var(--text-secondary));
    cursor: pointer;
    transition: all .12s;
}
.filter-chip:hover,
.lp-chip:hover,
.nl-chip:hover { border-color: var(--primary); color: var(--primary); }
.filter-chip.active,
.lp-chip.active,
.nl-chip.active {
    background: var(--fc-on-bg);
    border-color: var(--fc-on-bg);
    color: var(--fc-on-fg);
    font-weight: 600;
}
.filter-chip em,
.lp-chip em,
.nl-chip em { color: var(--text-muted); font-style: normal; font-variant-numeric: tabular-nums; }
.filter-chip.active em,
.lp-chip.active em,
.nl-chip.active em { color: var(--fc-on-fg); opacity: .92; }
/* 语义色：仅切换选中态底色，未选中仍是白底描边 */
.filter-chip.is-warn.active,
.lp-chip.lv-WARN.active,
.nl-chip.cls-4xx.active { --fc-on-bg: #d48806; }
.filter-chip.is-error.active,
.lp-chip.lv-ERROR.active,
.nl-chip.cls-5xx.active { --fc-on-bg: #cf1322; }

.ds-input {
    flex: 1 1 280px; min-width: 0; height: 32px; padding: 0 10px;
    border: 1px solid var(--border); border-radius: var(--radius-btn);
    background: var(--bg-card); color: var(--text-body);
    font-family: inherit; font-size: 12.5px; outline: none;
}
.ds-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--tag-bg); }
.ds-input:disabled { background: var(--bg-subtle); color: var(--text-muted); }
.ds-select {
    height: 32px; padding: 0 26px 0 8px;
    border: 1px solid var(--border); border-radius: var(--radius-btn);
    background: var(--bg-card); color: var(--text-body);
    font-family: inherit; font-size: 12.5px; outline: none;
}
.ds-select:focus { border-color: var(--primary); }
.ds-btn {
    height: 32px; padding: 0 12px;
    border: 1px solid var(--border); border-radius: var(--radius-btn);
    background: var(--bg-card); color: var(--text-body);
    font-family: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.ds-btn:hover { border-color: var(--primary); color: var(--primary); }
.ds-btn.primary { background: var(--primary); border-color: var(--primary); color: var(--bg-card); }
.ds-btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: var(--bg-card); }
.ds-btn:disabled { opacity: .55; cursor: not-allowed; }
.ds-btn:focus-visible, .ds-select:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.ds-notice { margin: 0; font-size: 12px; line-height: 1.65; color: var(--text-muted); overflow-wrap: anywhere; }
.ds-notice[data-state="ok"] { color: var(--success); }
.ds-notice[data-state="warn"] { color: var(--warning); }
.ds-notice[data-state="bad"] { color: var(--danger); }
.ds-drop {
    position: absolute; inset: 0; z-index: 5;
    display: none; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
    border: 2px dashed var(--primary); border-radius: var(--radius-card);
    background: var(--tag-bg); color: var(--primary);
    font-size: 13px; pointer-events: none;
}
.ds-drop svg { width: 26px; height: 26px; }
.ds-drop small { font-size: 11.5px; color: var(--text-muted); }
.ds-panel.ds-drag .ds-drop { display: flex; }
.ds-panel.ds-drag .code-editor, .ds-panel.ds-drag .ds-field { box-shadow: inset 0 0 0 2px var(--primary); }
@media (max-width: 640px) {
    .ds-extras { padding: 8px 12px 10px; }
    .ds-input { flex-basis: 100%; }
    .ds-row { gap: 6px; }
}


/* 详情页统一互链：相关文章行列表（标题 + 分类 + 日期，不用大卡封面） */
.related-article-list { border-top: 0; }
/* 清单感：每条 12px 上下留白，只在条目之间画一条极浅分隔线，最后一条不画 */
.related-article-row { display: block; padding: 12px 2px; border-bottom: 1px solid var(--border-light); }
.related-article-row:last-child { border-bottom: 0; }
/* 标题常规字重、正文色（非纯黑），悬停变主色并加下划线 */
.related-article-title { display: inline; font-size: 15px; font-weight: 400; color: var(--text-body); line-height: 1.6; }
.related-article-row:hover .related-article-title { color: var(--primary); text-decoration: underline; text-underline-offset: 2px; }
/* 元信息紧跟标题：8px 间距，超长标题换行时随内容折到下一行左侧 */
.related-article-meta { display: inline-flex; align-items: baseline; gap: 10px; margin-left: 8px;
                        font-size: 12px; color: var(--text-muted); white-space: nowrap; }
/* 箭头跟着内容走，不拉到最右 */
.related-article-row::after { content: '→'; display: inline; margin-left: 6px; font-size: 14px;
                              color: var(--text-muted); transition: color .15s, transform .15s; }
.related-article-row:hover::after { color: var(--primary); transform: translateX(2px); }
@media (max-width: 560px) {
    /* 窄屏：分类与日期折到标题下方并左对齐，箭头让位 */
    .related-article-meta { display: flex; margin-left: 0; margin-top: 4px; }
    .related-article-row::after { display: none; }
}

/* ===== 公告铃铛（导航右上角，网站公告的唯一入口） ===== */
.nav-notice { position: relative; display: flex; align-items: center; }
.nav-notice-btn {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    width: 32px; height: 32px; padding: 0; border: 1px solid var(--border); border-radius: 50%;
    background: #fff; color: var(--text-body); cursor: pointer; transition: all .2s; font-family: inherit;
}
.nav-notice-btn:hover { border-color: var(--primary); color: var(--primary); }
.nav-notice-btn svg { width: 18px; height: 18px; }
/* 未读红点：全部已读时由 JS 置 hidden，不显示 */
.nav-notice-dot {
    position: absolute; top: -4px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: #e5484d; color: #fff; font-size: 10px; font-weight: 700;
    line-height: 16px; text-align: center; white-space: nowrap; box-shadow: 0 0 0 2px #fff;
}
.nav-notice-dot[hidden] { display: none; }
.nav-notice-panel {
    position: absolute; top: calc(100% + 10px); right: 0; width: 320px; max-width: calc(100vw - 24px);
    background: #fff; border: 1px solid var(--border-light); border-radius: 12px;
    box-shadow: 0 10px 36px rgba(0, 0, 0, .14); z-index: 120; overflow: hidden;
}
.nav-notice-panel[hidden] { display: none; }
.nav-notice-head {
    padding: 12px 16px; font-size: 14px; font-weight: 600; color: var(--text-title);
    border-bottom: 1px solid var(--border-light); background: var(--surface);
}
/* 下拉只列标题（最多 8 条），超出时列表区滚动 */
.nav-notice-list { max-height: min(60vh, 420px); overflow-y: auto; overscroll-behavior: contain; }
.nav-notice-item {
    display: flex; align-items: flex-start; gap: 7px;
    padding: 11px 16px; border-bottom: 1px solid var(--border-light);
    font-size: 14px; font-weight: 400; color: var(--text-title); line-height: 1.55;
    text-decoration: none; transition: background .15s;
}
.nav-notice-item:last-child { border-bottom: 0; }
.nav-notice-item:hover, .nav-notice-item:focus-visible { background: var(--bg); color: var(--primary); }
/* 未读圆点固定占位（已读时透明），标题换行后文字仍从同一列开始 */
.nav-notice-item::before {
    content: ''; flex: none; width: 6px; height: 6px; margin-top: 8px;
    border-radius: 50%; background: #e5484d; opacity: 0;
}
.nav-notice-item.is-unread { font-weight: 700; }
.nav-notice-item.is-unread::before { opacity: 1; }
/* 标题单行省略，日期靠右固定宽度，不改变行高 */
.nav-notice-title {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-notice-date {
    flex: none; margin-left: 8px; font-size: 12px; font-weight: 400;
    line-height: 22px; color: var(--text-muted); white-space: nowrap;
}
/* 底部「查看全部公告」入口 */
.nav-notice-all {
    display: block; padding: 11px 16px; text-align: center; font-size: 13px; color: var(--primary);
    background: var(--surface); text-decoration: none; border-top: 1px solid var(--border-light);
}
.nav-notice-all:hover { background: var(--tag-bg); }

/* ===== 公告列表 / 详情 ===== */
/* 列表行沿用文章页 .related-article-row，这里只补充公告标题换行行为 */
.notice-row .related-article-title { line-height: 1.6; }
/* 详情正文：保留公告里的换行与连续空格，长串强制折行，不截断 */
.notice-detail-body { white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere; }
/* 详情底部：上一条 / 下一条 / 返回列表 */
.notice-nav {
    display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 40px; padding-top: 20px;
    border-top: 1px solid var(--border-light); font-size: 14px; color: var(--text-secondary);
}
.notice-nav a { color: var(--primary); }
.notice-nav a:hover { text-decoration: underline; text-underline-offset: 3px; }
.notice-nav-back { margin-left: auto; }
@media (max-width: 768px) {
    /* 手机端：铃铛放大点击区，并与搜索框留出间距，降低误触 */
    .nav-notice { margin-left: 6px; }
    .nav-notice-btn { width: 38px; height: 38px; }
    .nav-notice-btn svg { width: 20px; height: 20px; }
    /* 手机端：面板固定为浮层，左右留边、避开导航，不参与导航行布局也不撑破页面 */
    .nav-notice-panel {
        position: fixed; top: 70px; left: 12px; right: 12px; width: auto; max-width: none;
        max-height: calc(100vh - 90px);
    }
    .nav-notice-list { max-height: calc(100vh - 200px); }
    .notice-nav-back { margin-left: 0; }
}
