/* assets/css/systems/info-systems/how-ethernet-csma-cd-collision-detection-explained.css — 本页专属样式（en/zh 共用） */
/* ============ 以太网 CSMA/CD 冲突检测 · Ethernet CSMA/CD collision detection ============ */

body[data-topic="ethernet-csma-cd"] .svg-title{fill:var(--strong);font-family:var(--mono);font-size:17px;font-weight:600;letter-spacing:.06em}
body[data-topic="ethernet-csma-cd"] .tag{fill:#475569;font-family:var(--mono);font-size:13px;letter-spacing:.02em}
body[data-topic="ethernet-csma-cd"] .tag-sm{fill:#5b6472;font-size:11px}

/* 零件本体 */
body[data-topic="ethernet-csma-cd"] .part .body{fill:#c2d1e4;stroke:#2563eb;stroke-width:1.6}
body[data-topic="ethernet-csma-cd"] .part .body2{fill:#dde7f4;stroke:#60a5fa;stroke-width:1.2}

/* 车站区分色 */
body[data-topic="ethernet-csma-cd"] .part[data-id="part-station-a"]:not(.is-active) .body{fill:#bcd9f2}
body[data-topic="ethernet-csma-cd"] .part[data-id="part-station-b"]:not(.is-active) .body{fill:#f2d9bd}
body[data-topic="ethernet-csma-cd"] .part[data-id="part-station-c"]:not(.is-active) .body{fill:#c8c1e5}
body[data-topic="ethernet-csma-cd"] .part[data-id="part-bus"]:not(.is-active) .body{fill:#c6d0dd}

/* 共享总线 */
body[data-topic="ethernet-csma-cd"] .cs-bus{stroke:#8ea0b5;stroke-width:12;stroke-linecap:round}
body[data-topic="ethernet-csma-cd"] .cs-tap{stroke:#8ea0b5;stroke-width:4;stroke-linecap:round}

/* 时序图框 / 生命线 */
body[data-topic="ethernet-csma-cd"] .cs-timeline{fill:#ffffff;fill-opacity:.6;stroke:#e6ebf2;stroke-width:1.2}
body[data-topic="ethernet-csma-cd"] .cs-lane{stroke:#c3ccd9;stroke-width:1.4;stroke-dasharray:4 5}

/* 载波监听 */
body[data-topic="ethernet-csma-cd"] .cs-pill{fill:#dde7f4;stroke:#2563eb;stroke-width:1.4}

/* 发送流：A 蓝 / B 橙 */
body[data-topic="ethernet-csma-cd"] .cs-qa{fill:none;stroke:#2563eb;stroke-width:4;stroke-linecap:round;stroke-dasharray:12 7}
body[data-topic="ethernet-csma-cd"] .cs-qb{fill:none;stroke:#ea580c;stroke-width:4;stroke-linecap:round;stroke-dasharray:12 7}

/* 冲突 / 阻塞信号 */
body[data-topic="ethernet-csma-cd"] .cs-burst{fill:#fecdd3;stroke:#be123c;stroke-width:2.4}
body[data-topic="ethernet-csma-cd"] .cs-jam{stroke:#be123c;stroke-width:8;stroke-linecap:round}

/* 退避等待 */
body[data-topic="ethernet-csma-cd"] .cs-backoff{fill:#f3e6c8;stroke:#d97706;stroke-width:1.4;stroke-dasharray:6 5}

/* 重传成功 */
body[data-topic="ethernet-csma-cd"] .cs-retry{fill:none;stroke:#047857;stroke-width:5;stroke-linecap:round;stroke-dasharray:12 7}

/* 动画 */
body[data-topic="ethernet-csma-cd"] .is-running .cs-qa,
body[data-topic="ethernet-csma-cd"] .is-running .cs-qb,
body[data-topic="ethernet-csma-cd"] .is-running .cs-retry{animation:cs-march .65s linear infinite}
body[data-topic="ethernet-csma-cd"] .is-running .cs-burst{animation:cs-flash 2.4s ease-in-out infinite}
body[data-topic="ethernet-csma-cd"] .is-running .cs-jam{animation:cs-flash 2.4s ease-in-out infinite .35s}
body[data-topic="ethernet-csma-cd"] .is-running .cs-pill{animation:cs-listen 2.4s ease-in-out infinite}
body[data-topic="ethernet-csma-cd"] .is-running .cs-bus{animation:cs-pulse 2.4s ease-in-out infinite}
@keyframes cs-march{to{stroke-dashoffset:-19}}
@keyframes cs-flash{0%,100%{opacity:.35}50%{opacity:1}}
@keyframes cs-listen{0%,100%{opacity:.6}50%{opacity:1}}
@keyframes cs-pulse{0%,100%{stroke:#8ea0b5}50%{stroke:#2563eb}}

/* 高亮态（换色 + 描边加粗 + 发光） */
body[data-topic="ethernet-csma-cd"] .part.is-active .body{fill:#9dc3f5;stroke:#1d4ed8;stroke-width:2.2}
body[data-topic="ethernet-csma-cd"] .part.is-active .body2{fill:#c4daf8;stroke:#3b82f6;stroke-width:1.4}
body[data-topic="ethernet-csma-cd"] .part.is-active .cs-bus{stroke:#1d4ed8}
body[data-topic="ethernet-csma-cd"] .part.is-active{filter:drop-shadow(0 0 12px rgba(29,78,216,.5))}

@media (prefers-reduced-motion:reduce){
  body[data-topic="ethernet-csma-cd"] .is-running .cs-qa,
  body[data-topic="ethernet-csma-cd"] .is-running .cs-qb,
  body[data-topic="ethernet-csma-cd"] .is-running .cs-retry,
  body[data-topic="ethernet-csma-cd"] .is-running .cs-burst,
  body[data-topic="ethernet-csma-cd"] .is-running .cs-jam,
  body[data-topic="ethernet-csma-cd"] .is-running .cs-pill,
  body[data-topic="ethernet-csma-cd"] .is-running .cs-bus{animation:none;opacity:1}
}