/* 演示效果层：提示、弹层、高亮、加载态、切页、计数跳动、智能体逐步输出。不改变布局，只加动效和反馈。 */
#toasts { position: fixed; left: 50%; top: auto; bottom: 16px; transform: translateX(-50%); z-index: 120; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
#toasts .toast { position: static; transform: none; display: flex; align-items: center; gap: 8px; box-shadow: 0 10px 30px rgba(15,23,42,.18); max-width: 620px; pointer-events: auto; }
#toasts .toast .ti { width: 18px; height: 18px; border-radius: 50%; background: rgba(255,255,255,.22); display: inline-grid; place-items: center; font-size: 11px; font-weight: 700; flex: none; }
#toasts .toast.out { animation: toastOut .2s var(--ease, ease) forwards; }
@keyframes toastOut { to { opacity: 0; transform: translateY(-6px); } }

.modal-mask.closing { animation: fadeOut .16s ease forwards; }
.modal-mask.closing .modal { animation: popOut .16s ease forwards; }
@keyframes fadeOut { to { opacity: 0; } }
@keyframes popOut { to { opacity: 0; transform: scale(.97) translateY(4px); } }
.drawer { transition: transform .26s cubic-bezier(.2,.8,.2,1); }
.drawer-mask.open { animation: fadeIn .2s ease; }

/* 主操作按钮加载态 */
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; left: 50%; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; border: 2px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .7s linear infinite; }
.btn.loading:not(.pri):not(.blue):not(.dan)::after { border-color: rgba(26,144,255,.25); border-top-color: var(--blue, #1a8cff); }
@keyframes spin { to { transform: rotate(360deg); } }

/* 切页：顶部进度条 + 内容淡入 */
.pg-bar { position: fixed; left: 0; top: 0; height: 2px; width: 0; background: linear-gradient(90deg, #1a8cff, #7c5cf0); z-index: 130; transition: width .38s cubic-bezier(.2,.8,.2,1), opacity .2s ease .3s; box-shadow: 0 0 8px rgba(26,140,255,.5); }
.pg-bar.done { width: 100%; opacity: 0; }
.page.pg-enter > * { animation: pgIn .26s cubic-bezier(.2,.8,.2,1) both; }
.page.pg-enter > *:nth-child(2) { animation-delay: .04s; }
.page.pg-enter > *:nth-child(3) { animation-delay: .08s; }
@keyframes pgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* 处理后的结果：列表里短暂留下的已处理行，和右侧结果态 */
.list .li.ghost { background: #f3f5f8; cursor: default; }
.list .li.ghost:hover { background: #f3f5f8; }
.list .li.ghost .l2 { color: var(--green, #138a4c); font-weight: 600; }
.list .li.ghost.bad .l2 { color: var(--amber, #c77700); }
.list .li.ghost.ghost-out { overflow: hidden; pointer-events: none; animation: ghostFold .25s ease forwards; }
@keyframes ghostFold { from { max-height: 120px; opacity: 1; } to { max-height: 0; opacity: 0; padding-top: 0; padding-bottom: 0; border-bottom-width: 0; } }
.detail.result { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 36px 28px 28px; }
.detail.result .res-ico { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; background: var(--green-wash, #eaf7f0); color: var(--green, #138a4c); margin: 4px auto 16px; }
.detail.result .res-ico.bad { background: var(--amber-wash, #fff6e5); color: var(--amber, #c77700); }
.detail.result .res-line { font-size: 18px; font-weight: 600; line-height: 1.5; }
.detail.result .res-sub { margin-top: 10px; font-size: 13.5px; color: var(--ink2, #4b5563); display: flex; align-items: center; justify-content: center; gap: 10px; }
.detail.result .acts { width: 100%; justify-content: center; border-top: 0; }

/* 计数变化 */
.bump { animation: bump .5s cubic-bezier(.2,.8,.2,1); }
@keyframes bump { 0% { transform: scale(1); } 30% { transform: scale(1.28); box-shadow: 0 0 0 4px rgba(26,140,255,.18); } 100% { transform: scale(1); } }

/* 智能体逐步输出 */
.msg.st-wait { display: none; }
.msg.st-in { animation: pgIn .3s cubic-bezier(.2,.8,.2,1) both; }
.msg.st-in .st-step { animation: pgIn .28s cubic-bezier(.2,.8,.2,1) both; }
.msg.typing .body { display: flex; align-items: center; gap: 8px; color: var(--muted, #8a94a6); font-size: 13px; }
.dots { display: inline-flex; gap: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 50%; background: #9db8e6; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; } .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }

/* 顶栏：重置演示 */
.pbar .rst, #pbar .rst { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: #cbd5e1; padding: 3px 9px; border: 1px solid rgba(255,255,255,.16); border-radius: 999px; cursor: pointer; white-space: nowrap; }
.pbar .rst:hover, #pbar .rst:hover { color: #fff; border-color: rgba(255,255,255,.4); }

/* 网址高亮的功能点 */
.hl-pulse { position: relative; outline: 2px solid #1a8cff !important; outline-offset: 3px; border-radius: 6px; animation: hlPulse 1.6s ease-out 3; }
@keyframes hlPulse { 0% { box-shadow: 0 0 0 0 rgba(26,140,255,.45); } 100% { box-shadow: 0 0 0 14px rgba(26,140,255,0); } }
.hl-label { position: absolute; left: -2px; top: -24px; background: #1a8cff; color: #fff; font-size: 11.5px; line-height: 18px; padding: 1px 8px; border-radius: 6px 6px 6px 0; white-space: nowrap; z-index: 6; pointer-events: none; font-weight: 500; }
.hl-on { outline: 2px solid #7c5cf0 !important; outline-offset: 2px; border-radius: 6px; }

/* 追溯弹层 */
.pop { position: fixed; z-index: 110; width: 520px; max-width: calc(100vw - 24px); max-height: min(46vh, 420px); display: flex; flex-direction: column; background: #fff; border-radius: 14px; box-shadow: 0 24px 60px rgba(15,23,42,.24), 0 0 0 1px rgba(15,23,42,.06); animation: popIn .18s cubic-bezier(.2,.8,.2,1); font-size: 13px; color: var(--ink, #1f2937); }
.pop .pv-h { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px 10px; border-bottom: 1px solid var(--hair, #eef1f5); }
.pop .pv-h > div { flex: 1; min-width: 0; }
.pop .pv-t { font-size: 15px; font-weight: 600; line-height: 1.4; }
.pop .pv-s { font-size: 11.5px; color: var(--muted, #8a94a6); margin-top: 2px; }
.pop .pv-x { font-size: 18px; color: var(--muted, #8a94a6); cursor: pointer; line-height: 1; }
.pop .pv-b { padding: 8px 16px 12px; overflow: auto; flex: 1; min-height: 0; }
.pop .pv-r { display: grid; grid-template-columns: 64px 1fr; gap: 8px; padding: 5px 0; }
.pop .pv-k { color: var(--muted, #8a94a6); font-size: 12px; padding-top: 1px; }
.pop .pv-v { line-height: 1.6; }
.pop .pv-req { margin-top: 10px; padding: 8px 12px 6px; border-radius: 10px; background: #f7f9fc; border: 1px solid #edf1f7; }
.pop .pv-rh { display: flex; align-items: center; gap: 6px; padding-bottom: 4px; border-bottom: 1px dashed #e3e8f0; margin-bottom: 2px; }
.pop .pv-rh b { font-size: 13.5px; }
.pop .pv-rh .sp { flex: 1; }
.pop .pv-f { display: flex; gap: 12px; padding: 10px 16px; border-top: 1px solid var(--hair, #eef1f5); font-size: 12.5px; }
.pop .pv-f .sp { flex: 1; }
.pop .capn { display: inline-block; padding: 0 8px; border-radius: 999px; background: #eef5ff; color: #1f6fd1; font-size: 12px; line-height: 20px; }
body.trace .ann-tag { cursor: pointer; }

/* 追溯角标：默认只显示「期次·需求」，其余收在 .full 里，悬停再展开，不推动布局 */
body.trace span.ann-tag { z-index: 6; right: 0 !important; }
body.trace span.ann-tag .sep,
body.trace span.ann-tag .more { font-size: 0; line-height: 0; }
body.trace span.ann-tag .sep::after { content: "·"; font-size: 10px; line-height: 17px; }
body.trace span.ann-tag .more::after { content: " +" attr(data-n); font-size: 10px; line-height: 17px; }
body.trace span.ann-tag .full {
  display: inline-block; vertical-align: top; width: auto; max-width: 0; min-width: 0; overflow: hidden; opacity: 0;
  padding: 0; margin: 0; border: 0; background: transparent; color: inherit; font: inherit; line-height: inherit;
  white-space: nowrap; position: static; height: auto; transition: max-width .18s ease, opacity .18s ease;
}
body.trace [data-req]:hover > span.ann-tag,
body.trace span.ann-tag:hover { z-index: 80; box-shadow: 0 6px 16px rgba(15, 23, 42, .18); }
body.trace [data-req]:hover > span.ann-tag .full,
body.trace span.ann-tag:hover .full { max-width: 46em; opacity: 1; }
body.trace [data-req]:has([data-req]:hover) > span.ann-tag { z-index: 6; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
body.trace [data-req]:has([data-req]:hover) > span.ann-tag .full { max-width: 0; opacity: 0; }
/* 左栏角标留在入口旁的空位，完整段向内容区展开，不盖住入口文字 */
body.trace #side.side { overflow: visible; position: relative; z-index: 8; }
body.trace #side .scroll { overflow: visible; min-height: 0; }
body.trace #side .nav span.ann-tag {
  top: 50% !important; bottom: auto !important; left: auto !important; right: 36px !important;
  transform: translateY(-50%);
}
body.trace #side .nav span.ann-tag .full {
  position: absolute; left: 100%; top: 0; height: 17px; line-height: 17px;
  background: var(--new); border-radius: 0 4px 4px 0;
}
body.trace #side .tlist span.ann-tag {
  top: auto !important; bottom: calc(100% + 1px) !important; left: 0 !important; right: auto !important;
  transform: none;
}
/* 角色条状态行很窄，角标收到这一行上方的空白处 */
body.trace .rolebar span.ann-tag {
  top: auto !important; bottom: calc(100% + 1px) !important; right: -40px !important; left: auto !important;
}
/* 页签和按钮上的短标签改放到文字上方，向右展开，不压住标签本身 */
body.trace a > span.ann-tag,
body.trace button > span.ann-tag {
  top: auto !important; bottom: calc(100% + 1px) !important; left: 0 !important; right: auto !important;
}
/* 左栏「协同」上的待确认和本期新增改到文字旁边，不再叠在角标上 */
body.ann #side .nav > div[data-req] { display: flex; flex-wrap: wrap; align-items: center; }
body.ann #side .nav > div[data-req] > a { flex: 1 1 120px; }
body.ann #side .nav span.new-chip,
body.ann #side .nav span.tbc-tag {
  position: static !important; display: inline-flex !important; margin: 2px 0 2px 6px;
  top: auto !important; right: auto !important; bottom: auto !important; left: auto !important;
  transform: none !important; height: auto !important; white-space: normal; max-width: 100%;
}
/* 节点接管记录：列不够宽时横向滚动，不把「节点 B」拆成竖排 */
.hscroll { overflow-x: auto; max-width: 100%; }
.hscroll table.t { width: max-content; min-width: 100%; }
.hscroll table.t th, .hscroll table.t td { white-space: nowrap; word-break: keep-all; }
/* 手机屏幕内部滚动，底栏不盖住最后一张卡，句子不被卡片裁断 */
.phone .scr { min-height: 0; }
.phone .bd { min-height: 0; overflow: auto; }
.phone .mi { height: auto; overflow: visible; }
.phone .mi .t, .phone .mi .r { white-space: normal; overflow: visible; }
.phone .btn { white-space: normal; height: auto; min-height: 28px; line-height: 1.35; padding-top: 4px; padding-bottom: 4px; }
.phone .tb { position: relative; z-index: 2; background: #fff; }

/* 智能体逐步输出时，状态区先显示执行中，不露出最终结果的颜色 */
body.agent-running .syncing {
  position: relative !important; color: transparent !important; background: #eef2f6 !important; box-shadow: none !important;
  overflow: visible !important; width: auto !important; max-width: none !important; min-width: 0 !important;
  font-size: 0 !important; line-height: 0 !important; flex: none;
}
body.agent-running .syncing.tag::before { background: #c5ced8 !important; }
body.agent-running .syncing::after {
  content: "执行中"; position: static; transform: none; left: auto;
  display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 0; box-sizing: border-box;
  padding: 0 2px; border-radius: 4px; font-size: 11px; font-weight: 600; line-height: 18px; letter-spacing: 0; white-space: nowrap;
  color: #3e4e63; z-index: 2; pointer-events: none;
  background-color: rgba(238, 242, 246, .94);
  background-image: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, .95) 46%, transparent 78%);
  background-size: 220% 100%; background-repeat: no-repeat; animation: syncsheen 1.15s linear infinite;
}
.phone .btn.desk-off {
  background: #e8ecf2; color: #8a919f; border-color: #e8ecf2; cursor: default; box-shadow: none; opacity: 1;
}
@keyframes syncsheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
body.agent-running .rpanel { position: relative; }
body.agent-running .rpanel::before {
  content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 100%; transform: scaleX(0); transform-origin: left center;
  background: linear-gradient(90deg, #1a8cff, #7c5cf0); z-index: 6; pointer-events: none;
  animation: runbar var(--run, 2s) linear forwards; box-shadow: 0 0 6px rgba(26, 140, 255, .35);
}
@keyframes runbar { to { transform: scaleX(1); } }

@media (prefers-reduced-motion: reduce) {
  .pg-bar, .page.pg-enter > *, .bump, .msg.st-in, .msg.st-in .st-step, .hl-pulse, .pop, #toasts .toast, .li.ghost.ghost-out,
  body.trace span.ann-tag .full, body.agent-running .syncing::after, body.agent-running .rpanel::before { animation: none !important; transition: none !important; }
}
