/* 康方生物药本体 Demo · 页面样式（叠加在主站 styles.css 与 akeso.css 之上） */
#ontoNet { position: absolute; inset: 0; width: 100%; height: 100%; }
.wrap.wide { max-width: 1240px; }
.ont { --md: #4f6bed; --md-bg: #eef1ff; --bz: #c46a00; --bz-bg: #fff4e5; --dc: #0f8a5f; --dc-bg: #e6f6ef; --rl: #8b5cf6; --rl-bg: #f1ebff; }

/* 01 对象图谱 */
.og-wrap { display: grid; grid-template-columns: 1fr 340px; gap: 20px; margin-top: 48px; background: #fff; border-radius: 28px; padding: 20px; box-shadow: 0 30px 60px -36px rgba(0,0,0,.25); }
.og-graph { min-width: 0; }
.og-graph svg { width: 100%; height: auto; display: block; }
.og-graph text { font-family: var(--font); }
.oe { stroke: #e3e3e8; stroke-width: 1.5; transition: stroke .3s, opacity .3s; }
.oe.on { stroke: var(--ak); stroke-width: 2; stroke-dasharray: 6 5; animation: oeDash 1s linear infinite; }
.oe.path { stroke: #ff9f0a; stroke-width: 3; stroke-dasharray: 8 5; animation: oeDash .7s linear infinite; }
@keyframes oeDash { to { stroke-dashoffset: -22; } }
.ol rect { fill: #fff; stroke: #ececf0; }
.ol text { font-size: 11px; fill: #8e8e93; text-anchor: middle; }
.ol.on rect { stroke: #c5cdfa; } .ol.on text { fill: var(--ak); font-weight: 600; }
.ol.path rect { stroke: #ffb340; fill: #fff8ee; } .ol.path text { fill: #c46a00; font-weight: 700; }
.onode { cursor: pointer; transition: opacity .3s; }
.onode rect { stroke-width: 1.5; transition: transform .3s var(--ease); transform-box: fill-box; transform-origin: center; }
.onode text.n { font-size: 14px; font-weight: 700; text-anchor: middle; }
.onode text.c { font-size: 10.5px; text-anchor: middle; fill: #8e8e93; }
.onode:hover rect, .onode.pick rect { transform: scale(1.06); }
.onode.pick rect { stroke-width: 3; filter: drop-shadow(0 6px 14px rgba(79,107,237,.35)); }
.onode.hit rect { stroke: #ff9f0a; stroke-width: 3; filter: drop-shadow(0 0 10px rgba(255,159,10,.6)); }
.onode .halo { fill: none; stroke-width: 2; opacity: 0; transform-box: fill-box; transform-origin: center; }
.onode.pick .halo { animation: onHalo 1.8s infinite var(--ease); }
@keyframes onHalo { from { transform: scale(1); opacity: .5; } to { transform: scale(1.35); opacity: 0; } }
/* 首次进入：节点依次弹出 */
.onode { opacity: 0; transform: scale(.6); transform-box: fill-box; transform-origin: center; }
#og.in .onode { animation: onPop .5s cubic-bezier(.3,1.5,.5,1) both; animation-delay: var(--d); }
@keyframes onPop { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: none; } }
#og.ready .onode { animation: none; opacity: 1; transform: none; }
#og.ready .onode.dim { opacity: .3; }
.og-lg { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.og-lg span::before { content: ""; display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 5px; vertical-align: -2px; background: var(--b); border: 1.5px solid var(--c); }

.og-card { background: var(--bg-light); border-radius: 20px; padding: 20px; align-self: stretch; animation: cardIn .35s var(--ease); }
@keyframes cardIn { from { opacity: .3; transform: translateY(6px); } }
.og-card .k { font-size: 12px; font-weight: 600; color: var(--c, var(--ak)); }
.og-card h4 { font-size: 24px; letter-spacing: -.01em; margin: 2px 0 2px; }
.og-card .en { font-size: 12px; color: #8e8e93; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.og-card h5 { font-size: 11px; font-weight: 700; color: var(--ink-2); letter-spacing: .04em; margin: 14px 0 6px; }
.og-card .attrs { display: grid; gap: 4px; }
.og-card .attrs div { display: grid; grid-template-columns: 82px 1fr; gap: 8px; font-size: 12.5px; background: #fff; border-radius: 8px; padding: 5px 9px; animation: cardIn .35s var(--ease) both; animation-delay: calc(var(--i) * .04s); }
.og-card .attrs span { color: #8e8e93; }
.og-card .attrs b { font-weight: 600; font-variant-numeric: tabular-nums; }
.og-card .tags { display: flex; flex-wrap: wrap; gap: 5px; }
.og-card .tags span { font-size: 12px; padding: 3px 10px; border-radius: 980px; background: #fff; color: #3a3a3c; }
.og-card .tags span.src { background: #1d1d1f; color: #fff; }
.og-card .tags span.act { background: var(--ak); color: #fff; }
.og-card .meta { display: flex; gap: 14px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.og-card .meta b { color: var(--ink); font-size: 18px; margin-right: 2px; }

.ask { margin-top: 20px; background: #fff; border-radius: 22px; padding: 18px 22px; }
.ask-k { font-size: 12px; font-weight: 700; color: var(--ak); letter-spacing: .04em; }
.ask-q { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ask-q button { font-size: 13.5px; padding: 7px 14px; border-radius: 980px; border: 1px solid var(--line); color: #3a3a3c; transition: all .2s; }
.ask-q button:hover { border-color: var(--ak); color: var(--ak); }
.ask-q button[aria-pressed="true"] { background: var(--ak); border-color: var(--ak); color: #fff; font-weight: 600; }
.ask-a { margin-top: 12px; font-size: 15px; line-height: 1.6; min-height: 1.6em; }
.ask-a b { color: var(--ak); }
.ask-a small { display: block; font-size: 12px; color: #8e8e93; margin-top: 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* 02 影响追溯 */
.tr-ev { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 40px; }
.tr-ev button { padding: 9px 18px; border-radius: 980px; font-size: 14px; color: #d1d1d6; border: 1px solid #3a3a3c; transition: all .25s; }
.tr-ev button[aria-pressed="true"] { background: #ff9f0a; border-color: #ff9f0a; color: #1d1d1f; font-weight: 700; box-shadow: 0 0 0 4px rgba(255,159,10,.2); }
.tr { margin-top: 24px; background: #111113; border: 1px solid #222; border-radius: 28px; padding: 20px 20px 10px; }
.tr-cols { display: grid; grid-template-columns: repeat(5, 1fr); text-align: center; font-size: 12px; font-weight: 600; color: #8e8e93; letter-spacing: .04em; }
.tr svg { width: 100%; height: auto; display: block; }
.tr text { font-family: var(--font); }
.tl-link { fill: none; stroke-width: 2; stroke-dasharray: 1; stroke-dashoffset: 1; animation: trDraw .7s var(--ease) forwards; animation-delay: var(--d); opacity: .75; }
@keyframes trDraw { to { stroke-dashoffset: 0; } }
.tn { opacity: 0; animation: trNode .45s cubic-bezier(.3,1.4,.5,1) forwards; animation-delay: var(--d); transform-box: fill-box; transform-origin: center; }
@keyframes trNode { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: none; } }
.tn rect { stroke-width: 1.5; }
.tn text { font-size: 12.5px; font-weight: 600; text-anchor: middle; fill: #fff; }
.tn text.s { font-size: 10.5px; font-weight: 500; fill: #a1a1a6; }
.tn.ev rect { fill: #3d2a08; stroke: #ff9f0a; }
.tn.ev { animation-name: trNode, trPulse; animation-duration: .45s, 1.6s; animation-iteration-count: 1, infinite; animation-delay: var(--d), 1s; }
@keyframes trPulse { 50% { filter: drop-shadow(0 0 10px rgba(255,159,10,.7)); } }
.tn.rs rect { fill: #2a1414; stroke: #ff6961; }
.tn.bt rect { fill: #1c1c1e; stroke: #3a3a3c; }
.tn.bt.late rect { stroke: #ff6961; }
.tn.pd rect { fill: #161d4a; stroke: var(--ak-2); }
.tn.dm rect { fill: #0e2a1f; stroke: #34d399; }
.tn.dm.late rect { fill: #2a1414; stroke: #ff6961; }
.tr-sum { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 16px; }
.tr-sum > div { background: #111113; border: 1px solid #222; border-radius: 18px; padding: 16px 18px; }
.tr-sum b { display: block; font-size: 30px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tr-sum b.bad { color: #ff6961; } .tr-sum b.ok { color: #34d399; }
.tr-sum span { font-size: 12.5px; color: var(--ink-inv-2); }
.tr-sum .act { grid-column: 1 / -1; font-size: 14px; color: #e5e5ea; line-height: 1.6; }
.tr-sum .act em { font-style: normal; color: #ffb340; font-weight: 600; }

/* 03 规则与动作 */
.rules { display: grid; gap: 10px; margin-top: 48px; }
.rule { display: grid; grid-template-columns: 56px 1fr 1.15fr 88px; gap: 14px; align-items: center; background: #fff; border-radius: 16px; padding: 14px 18px; }
.rule .id { font-size: 13px; font-weight: 700; color: var(--rl); }
.rule .biz b { display: block; font-size: 15px; }
.rule .biz span { font-size: 12px; color: var(--ink-2); }
.rule code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12.5px; color: #3949ab; background: #f5f6ff; border-radius: 8px; padding: 7px 10px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rule code i { display: inline-block; width: 7px; height: 14px; vertical-align: -2px; background: var(--ak); margin-left: 1px; animation: caret .8s steps(1) infinite; font-style: normal; }
@keyframes caret { 50% { opacity: 0; } }
.rule .on-obj { font-size: 12px; text-align: right; color: var(--ink-2); }
.rule .on-obj b { display: block; color: var(--ink); font-size: 13px; }
.acts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 24px; }
.act { position: relative; background: #1d1d1f; color: #fff; border-radius: 20px; padding: 18px 18px 16px; overflow: hidden; }
.act::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--ak), #22b8cf); }
.act.in::before { animation: actBar 4s infinite var(--ease); animation-delay: calc(var(--i) * 1s); }
@keyframes actBar { 0% { width: 0; } 25%, 100% { width: 100%; } }
.act b { font-size: 18px; }
.act p { font-size: 13px; color: var(--ink-inv-2); margin-top: 4px; }
.act em { display: inline-block; margin-top: 10px; font-style: normal; font-size: 12px; font-weight: 600; color: var(--ak-2); background: rgba(79,107,237,.18); padding: 3px 10px; border-radius: 980px; }
.acts .reveal:nth-child(2) { transition-delay: .06s; } .acts .reveal:nth-child(3) { transition-delay: .12s; } .acts .reveal:nth-child(4) { transition-delay: .18s; }

/* 04 数据来源 */
.sm { max-width: 860px; margin: 48px auto 0; background: var(--bg-light); border-radius: 28px; padding: 20px; }
.sm svg { width: 100%; height: auto; display: block; }
.sm text { font-family: var(--font); }
.sm-sys rect { fill: #1d1d1f; } .sm-sys text { fill: #fff; font-size: 14px; font-weight: 700; text-anchor: middle; }
.sm-obj rect { fill: #fff; stroke: #c5cdfa; stroke-width: 1.5; } .sm-obj text { fill: var(--ink); font-size: 14px; font-weight: 600; text-anchor: middle; }
.sm-hub circle { fill: var(--ak); } .sm-hub text { fill: #fff; font-size: 13px; font-weight: 700; text-anchor: middle; }
.sm-ln { fill: none; stroke: #d2d2d7; stroke-width: 1.5; stroke-dasharray: 1; stroke-dashoffset: 1; transition: stroke-dashoffset 1.2s var(--ease); transition-delay: var(--d); }
#sm.in .sm-ln { stroke-dashoffset: 0; }
.sm-dot { fill: var(--ak); }
.sm-ring { fill: none; stroke: var(--ak); stroke-width: 2; animation: onHalo 2.4s infinite var(--ease); transform-box: fill-box; transform-origin: center; }
.spec3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 860px; margin: 16px auto 0; }
.spec3 > div { background: var(--bg-light); border-radius: 18px; padding: 16px 18px; text-align: center; }
.spec3 b { display: block; font-size: 24px; color: var(--ak); }
.spec3 span { font-size: 13px; color: var(--ink-2); }
.spec3 .reveal:nth-child(2) { transition-delay: .06s; } .spec3 .reveal:nth-child(3) { transition-delay: .12s; }

/* ---------- 响应式 ---------- */
@media (max-width: 1068px) {
  .og-wrap { grid-template-columns: 1fr; }
  .acts { grid-template-columns: repeat(2, 1fr); }
  .rule { grid-template-columns: 48px 1fr; }
  .rule code { grid-column: 1 / -1; }
  .rule .on-obj { grid-column: 1 / -1; text-align: left; }
  .rule .on-obj b { display: inline; margin-right: 6px; }
}
@media (max-width: 833px) {
  .tr-sum { grid-template-columns: repeat(2, 1fr); }
  .tr { padding: 14px 8px 6px; overflow-x: auto; }
  .tr-cols, .tr svg { min-width: 640px; }
}
@media (max-width: 560px) {
  .og-wrap { padding: 10px; border-radius: 20px; }
  .og-graph { overflow-x: auto; } .og-graph svg { min-width: 680px; }
  .acts, .spec3 { grid-template-columns: 1fr; }
  .sm { padding: 10px; border-radius: 20px; }
  .sm text { font-size: 18px !important; }
}
@media (prefers-reduced-motion: reduce) {
  .onode { opacity: 1; transform: none; }
  .tn { opacity: 1; animation: none; } .tl-link { stroke-dashoffset: 0; animation: none; }
  .sm-ln { stroke-dashoffset: 0; }
}
