/* Agent 架构动画图：浅色卡片 + 柔和节点，博客正文和对比台共用 */
.agf {
  --agf-ink: #263f30;
  --agf-muted: #5f7262;
  --agf-line: #d9e3d4;
  --agf-edge: #a3afa4;
  --agf-accent: #38664b;
  margin: 30px 0;
  padding: 0;
  border: 1px solid var(--agf-line);
  border-radius: 12px;
  background: #fbfcf8;
  color: var(--agf-ink);
  line-height: 1.6;
  font-size: 14px;
  overflow: hidden;
}
.agf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 14px 18px 0; }
.agf-titles { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.agf-kicker { font: 500 11px "Cascadia Code", Consolas, monospace; letter-spacing: .06em; color: var(--agf-muted); text-transform: uppercase; }
.agf-title { font-size: 15px; font-weight: 600; color: var(--agf-ink); }
.agf-open { flex: none; font-size: 12px; color: var(--agf-accent); border: 1px solid var(--agf-line); border-radius: 999px; padding: 2px 10px; background: #fff; }
.agf-open:hover { text-decoration: none; border-color: var(--agf-accent); }

.agf-canvas { padding: 4px 8px 0; overflow-x: auto; }
.agf-canvas svg { display: block; width: 100%; height: auto; min-width: 500px; }
.agf-fallback { margin: 0; padding: 18px; color: var(--agf-muted); font-size: 13px; }

/* 节点 */
.agf-node { transition: opacity .35s ease; }
.agf-node .box { stroke-width: 1.3; transition: stroke .25s ease, stroke-width .25s ease, fill .25s ease; }
.agf-node .ring { fill: none; stroke: var(--agf-accent); stroke-width: 1.4; stroke-dasharray: 5 4; opacity: 0; }
.agf-node .rule { stroke-width: 1; }
.agf-node .label { font-size: 13px; font-weight: 600; fill: var(--agf-ink); }
.agf-node .sub { font-size: 10.5px; fill: var(--agf-muted); }
.agf-node.t-llm .box { fill: #e8f1e2; stroke: #86a982; }
.agf-node.t-human .box, .agf-node.t-ext .box { fill: #f7ede2; stroke: #c9a175; }
.agf-node.t-code .box { fill: #eef1f4; stroke: #8f9cab; }
.agf-node.t-tool .box { fill: #e7eff6; stroke: #85a3c0; }
.agf-node.t-store .box { fill: #f5f1e3; stroke: #b9aa7c; }
.agf-node.t-store .rule { stroke: #b9aa7c; }
.agf-node.hit .box { stroke: var(--agf-accent); stroke-width: 2.2; }
.agf-node.t-llm.hit .box { fill: #dcebd4; }
.agf-node.owner .ring { opacity: .9; animation: agf-march 1.2s linear infinite; }
.agf-node.gone { opacity: .16; }

/* 连线 */
.agf-edge { fill: none; stroke: var(--agf-edge); stroke-width: 1.3; transition: stroke .25s ease, stroke-width .25s ease, opacity .35s ease; }
.agf-edge.dashed { stroke-dasharray: 5 4; }
.agf-edge.static { stroke-dasharray: 2 4; stroke: #c3ccc2; }
.agf-edge.on { stroke: var(--agf-accent); stroke-width: 2; }
.agf-edge.gone { opacity: .12; }
.agf-arrow { fill: var(--agf-edge); }
.agf-arrow.on { fill: var(--agf-accent); }
.agf-elabel { font-size: 10.5px; fill: var(--agf-muted); paint-order: stroke; stroke: #fbfcf8; stroke-width: 4px; stroke-linejoin: round; }
.agf-packet { fill: var(--agf-accent); stroke: #fff; stroke-width: 2; }

/* 播放条 */
.agf-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 14px 10px; border-top: 1px solid #e6ece2; background: #fff; }
.agf button { font: inherit; color: var(--agf-ink); background: #f2f6ef; border: 1px solid var(--agf-line); border-radius: 8px; cursor: pointer; }
.agf button:hover { border-color: #9fb59d; }
.agf-play { width: 32px; height: 32px; padding: 0; font-size: 11px; color: #fff !important; background: var(--agf-accent) !important; border-color: var(--agf-accent) !important; }
.agf-caption { display: flex; align-items: baseline; gap: 10px; min-height: 22px; font-size: 13.5px; }
.agf-no { flex: none; font: 600 11px "Cascadia Code", Consolas, monospace; color: var(--agf-accent); }
.agf-text { color: var(--agf-ink); }
.agf-nav { display: flex; gap: 6px; }
.agf-nav button { width: 30px; height: 30px; padding: 0; font-size: 16px; line-height: 1; }
.agf-track { display: flex; gap: 3px; padding: 0 14px 12px; background: #fff; }
.agf .agf-seg { flex: 1; height: 4px; padding: 0; border: 0; border-radius: 2px; background: #e3e9df; }
.agf .agf-seg.done { background: #a9c3a6; }
.agf .agf-seg.cur { background: var(--agf-accent); }

/* 缩略图：只画结构 */
.agf.agf-thumb { margin: 0; border-radius: 10px; }
.agf-thumb .agf-head { padding: 10px 12px 0; }
.agf-thumb .agf-title { font-size: 14px; }
.agf-thumb .agf-kicker { display: none; }
.agf-thumb .agf-canvas { padding: 0 4px 4px; overflow: hidden; }
.agf-thumb .agf-canvas svg { min-width: 0; }
.agf-thumb .agf-elabel { display: none; }

/* 图例 */
.agf-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 18px 0; padding: 12px 16px; border: 1px solid #d9e3d4; border-radius: 10px; background: #fbfcf8; font-size: 12.5px; line-height: 1.5; color: #5f7262; }
.agf-legend span { display: inline-flex; align-items: center; gap: 7px; }
.agf-legend i { display: inline-block; width: 20px; height: 13px; border: 1.3px solid; border-radius: 4px; }
.agf-legend .t-llm i { background: #e8f1e2; border-color: #86a982; }
.agf-legend .t-human i, .agf-legend .t-ext i { background: #f7ede2; border-color: #c9a175; border-radius: 7px; }
.agf-legend .t-code i { background: #eef1f4; border-color: #8f9cab; }
.agf-legend .t-tool i { background: #e7eff6; border-color: #85a3c0; }
.agf-legend .t-store i { background: #f5f1e3; border-color: #b9aa7c; }
.agf-legend .flow i { width: 22px; height: 0; border: 0; border-top: 2px solid #38664b; border-radius: 0; }
.agf-legend .owner i { border: 1.4px dashed #38664b; background: transparent; border-radius: 6px; }

@keyframes agf-march { to { stroke-dashoffset: -18; } }
@media (max-width: 640px) {
  .agf { margin: 24px -4px; }
  .agf-head { padding: 12px 14px 0; }
  .agf-bar { gap: 10px; padding: 8px 12px 10px; }
  .agf-caption { font-size: 13px; }
  .agf-canvas { padding: 4px 2px 0; }
  .agf-canvas svg { min-width: 0; }
  .agf-node .label { font-size: 16px; }
  .agf-node .sub { font-size: 12.5px; }
  .agf-elabel { font-size: 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .agf-node.owner .ring { animation: none; }
  .agf-node, .agf-edge, .agf-node .box { transition: none; }
}
.agf-note { margin: 0; padding: 10px 18px 12px; border-top: 1px solid #e6ece2; background: #fff; color: var(--agf-muted); font-size: 12.5px; }
