/* 自己试一次：demo 页专属样式。变量和基础组件来自 site.css */

.demo-hero { padding-bottom: 0; }
.demo-hero h1 { margin: 0 0 14px; font-size: clamp(30px, 4vw, 46px); letter-spacing: -.02em; }
.demo-hero p { margin: 0 0 10px; color: var(--ink-2); max-width: 46em; font-size: clamp(15px, 1.6vw, 18px); }
/* 它字号比正文小，46em 会跟着缩，右边界就和上面的段落错开；
   选择器要压过 .demo-hero p，否则又被 46em 按回去 */
.demo-hero .demo-privacy {
  max-width: 828px;
}
.demo-privacy {
  margin-top: 18px !important; padding: 12px 16px; border: 1px solid var(--accent-dim);
  border-radius: 10px; background: var(--surface);
  color: var(--ink-2) !important; font-size: 14px !important;
}
.demo-privacy b { color: var(--accent); }

/* 输入区 */
.demo-input {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: clamp(18px, 3vw, 28px);
}
.demo-label { display: block; font-size: 13.5px; color: var(--ink-3); margin-bottom: 8px; letter-spacing: .02em; }
#samples .demo-label { display: inline; margin-right: 6px; }
.demo-input textarea {
  width: 100%; min-height: 180px; resize: vertical;
  font: inherit; font-size: 14.5px; line-height: 1.75;
  color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px;
}
.demo-input textarea:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; border-color: var(--accent-dim); }
.demo-tools { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; margin-top: 14px; }
.demo-tools-r { display: inline-flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chip {
  font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer;
  color: var(--ink-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px; min-height: 36px;
  transition: border-color .15s, color .15s;
}
.chip:hover { border-color: var(--accent-dim); color: var(--ink); }
.demo-note { margin: 14px 0 0; font-size: 13px; color: var(--ink-3); }
.demo-empty { text-align: center; color: var(--ink-3); font-size: 14.5px; padding: clamp(36px, 6vw, 64px) 0; }

/* 统计条 */
.demo-stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px;
  margin: clamp(28px, 4vw, 44px) 0 18px;
}
.demo-stats div { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; }
.demo-stats b { display: block; font-size: clamp(26px, 3vw, 36px); letter-spacing: -.03em; line-height: 1.05; color: var(--ink); font-variant-numeric: tabular-nums; }
.demo-stats span { font-size: 13px; color: var(--ink-3); }
.demo-stats .zero b { color: var(--accent); }

/* 画布 */
.demo-stage { margin-top: 6px; }
.demo-bar { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: 14px; }
.demo-bar-note { font-size: 13.5px; color: var(--accent); }
.demo-canvas {
  position: relative; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line); border-radius: 16px;
  background-image: radial-gradient(circle, #ddd6e8 1px, transparent 1.2px);
  background-size: 22px 22px;
}
.demo-inner { position: relative; transform-origin: 0 0; }
.demo-inner svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.demo-inner svg path { fill: none; stroke: var(--accent-dim); stroke-width: 1.4; opacity: .75; }
body.ai-mode .demo-inner svg path { stroke: var(--accent-2); opacity: .5; }

/* 画布上的节点 */
.dnode {
  position: absolute; box-sizing: border-box;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; font-size: 12.5px; line-height: 1.5;
  display: flex; flex-direction: column; gap: 3px; overflow: hidden;
  transition: border-color .2s;
}
.dnode .dkind { order: -1; font-size: 11px; color: var(--ink-3); letter-spacing: .03em; }
.dnode b { font-weight: 600; color: var(--ink); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dnode .dmeta { color: var(--ink-3); font-size: 11.5px; }
.dnode .danchor { color: var(--accent); font-size: 11.5px; }
.d-entity { border-radius: 999px; justify-content: center; background: var(--surface); }
.d-entity b { -webkit-line-clamp: 2; }
body.ai-mode .d-entity { border-color: var(--accent-2); }
body.ai-mode .d-entity b { color: var(--accent); }
.d-finding { border-style: dashed; border-color: var(--warn); }
.d-finding .dkind { color: var(--warn); }
body.ai-mode .d-card { border-color: var(--accent-dim); }

/* 线索 */
.demo-findings { margin-top: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: clamp(18px, 3vw, 26px); }
.demo-findings h3 { margin: 0 0 12px; font-size: 17px; }
.demo-findings ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.demo-findings li {
  display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: baseline;
  padding: 10px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
.demo-findings li b { color: var(--warn); font-size: 13px; white-space: nowrap; }
.demo-findings li span { color: var(--ink); font-size: 14px; }
.demo-findings li em { grid-column: 2; font-style: normal; color: var(--ink-3); font-size: 12.5px; }
.demo-findings .demo-note { margin-top: 12px; }

/* 收尾：与正文共用同一条左基线。原来整块居中，跟全站左对齐的排版语言打架 */
.demo-end { border-top: 1px solid var(--line); padding: clamp(52px, 6.5vw, 80px) 0; }
.demo-end .wrap {
  display: flex; align-items: center; justify-content: space-between;
  gap: clamp(24px, 4vw, 56px); flex-wrap: wrap;
}
.demo-end-lede {
  margin: 0; flex: 1 1 0; max-width: 48em;
  color: var(--ink-2); font-size: clamp(15px, 1.3vw, 17px); line-height: 1.7;
}

@media (max-width: 720px) {
  .demo-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .demo-tools { flex-direction: column; align-items: stretch; }
  .demo-tools-r { justify-content: space-between; }
}

/* 跑完之后的下一步：此刻访客最有话说，不用让他滚到页尾 */
.demo-after {
  margin-top: clamp(24px, 3vw, 36px);
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid var(--accent-dim);
  border-radius: 14px;
  background: var(--surface);
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 40px);
  flex-wrap: wrap;
}
.demo-after p { margin: 0; flex: 1 1 320px; color: var(--ink-2); font-size: 15px; line-height: 1.6; }
.demo-after b { color: var(--ink); font-weight: 600; }
