/* ===== 电线管穿线数量 · 计算流图 ===== */
.cwf {
    background: #fdfbf7;
    border: 1px solid #ece5d8;
    border-radius: 10px;
    padding: 24px 22px;
    margin-bottom: 26px;
    box-shadow: 0 8px 26px rgba(96, 74, 40, .06);
}

.cwf-flow { display: flex; align-items: stretch; gap: 0; }
.cwf-node {
    flex: 1 1 0; min-width: 0;
    background: #fff; border: 1px solid #ece5d8; border-radius: 8px;
    padding: 13px 14px 12px; display: flex; flex-direction: column; gap: 5px;
    position: relative;
}
.cwf-node b { font-size: 12.5px; color: #40382c; line-height: 1.3; }
.cwf-node-tag {
    font-size: 9.5px; letter-spacing: .1em; color: #a89c7c;
    text-transform: uppercase;
}
.cwf-node output {
    font-size: 30px; line-height: 1; color: #b45309;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums; font-weight: 700;
}
.cwf-node output.cwf-out-sm { font-size: 22px; }
.cwf-node > em { font-style: normal; font-size: 10px; color: #a89c7c; margin-top: -2px; }
.cwf-node p { margin: 2px 0 0; font-size: 10.5px; line-height: 1.55; color: #8a8271; }
.cwf-formula {
    font-family: ui-monospace, monospace; font-size: 10.5px; color: #8a8271;
    background: #f7f2e8; border-radius: 4px; padding: 3px 6px; align-self: flex-start;
}
.cwf-meta { font-family: ui-monospace, monospace; }
.cwf-meta span { color: #9a3412; font-weight: 700; }

.cwf-link { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; position: relative; }
.cwf-link::before {
    content: ''; position: absolute; left: 4px; right: 8px; top: 50%;
    height: 1px; background: #ded5c2;
}
.cwf-link i {
    width: 0; height: 0; border-left: 6px solid #b8ad91;
    border-top: 4px solid transparent; border-bottom: 4px solid transparent;
    position: relative; z-index: 1; margin-left: 6px;
}

.cwf-node--out { background: #fffdf6; }
.cwf-badge {
    margin-top: 2px; display: inline-block; align-self: flex-start;
    font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 3px;
    background: #f3f0e9; color: #6b6555; border: 1px solid #e2dccd;
}
.cwf-badge.is-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.cwf-badge.is-bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

/* 管内示意 */
.cwf-view {
    width: 92px; height: 92px; border-radius: 50%;
    background: #f3f0e9; border: 3px solid #d9cfb9;
    position: relative; flex: 0 0 92px; margin-top: 2px;
}
.cwf-wire {
    position: absolute; border-radius: 50%;
    background: radial-gradient(circle at 32% 30%, #fbbf24, #b45309);
    box-shadow: 0 0 0 .5px rgba(120, 70, 10, .35);
}
.cwf-view.is-over { border-color: #e5a6a6; background: #fdf2f2; }
.cwf-view.is-over .cwf-wire { background: radial-gradient(circle at 32% 30%, #f87171, #b91c1c); }
.cwf-view.is-over .cwf-limit { background: #b91c1c; }
.cwf-limit {
    position: absolute; right: -6px; bottom: -6px;
    background: #b45309; color: #fff; font-size: 9px; font-weight: 700;
    padding: 1px 5px; border-radius: 8px;
}

.cwf-params { margin-top: 20px; border-top: 1px solid #ece5d8; padding-top: 16px; }
.cwf-params h2 { font-size: 12px; letter-spacing: .08em; color: #6b6555; margin: 0 0 12px; }
.cwf-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.cwf-grid label { display: flex; flex-direction: column; gap: 4px; }
.cwf-grid span { font-size: 11px; color: #8a8271; }
.cwf-grid input, .cwf-grid select {
    font: inherit; font-size: 12.5px; padding: 7px 9px; border: 1px solid #e2dccd;
    border-radius: 5px; background: #fff; color: #40382c; font-variant-numeric: tabular-nums;
}
.cwf-grid input:focus, .cwf-grid select:focus { outline: 2px solid rgba(180, 83, 9, .22); border-color: #b45309; }
.cwf-grid input.is-bad { border-color: #dc2626; background: #fef2f2; }

.cwf-basis { margin-top: 18px; border-top: 1px dashed #e2dccd; padding-top: 14px; }
.cwf-basis h2 { font-size: 12px; color: #6b6555; margin: 0 0 8px; letter-spacing: .06em; }
.cwf-basis ul { margin: 0; padding-left: 18px; }
.cwf-basis li { font-size: 11.5px; line-height: 1.8; color: #8a8271; }
.cwf-basis code { background: #f7f2e8; padding: 1px 4px; color: #b45309; }

@media (max-width: 980px) {
    .cwf-flow { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
    .cwf-link { display: none; }
    .cwf-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
    .cwf { padding: 16px 14px; }
    .cwf-flow { grid-template-columns: 1fr; }
    .cwf-grid { grid-template-columns: 1fr; }
    .cwf-node output { font-size: 26px; }
}

/* 深色模式 */
[data-theme="dark"] .cwf { background: #14120d; border-color: #2c2a22; box-shadow: none; }
[data-theme="dark"] .cwf-node { background: #1a1812; border-color: #2c2a22; }
[data-theme="dark"] .cwf-node b { color: #e7e2d4; }
[data-theme="dark"] .cwf-node-tag { color: #8a8271; }
[data-theme="dark"] .cwf-node output { color: #fbbf24; }
[data-theme="dark"] .cwf-node p, [data-theme="dark"] .cwf-node > em, [data-theme="dark"] .cwf-formula { color: #8a8271; }
[data-theme="dark"] .cwf-formula { background: #221f17; }
[data-theme="dark"] .cwf-meta span { color: #fbbf24; }
[data-theme="dark"] .cwf-node--out { background: #1c1913; }
[data-theme="dark"] .cwf-view { background: #221f17; border-color: #3a362a; }
[data-theme="dark"] .cwf-badge { background: #221f17; border-color: #2c2a22; color: #a8a08d; }
[data-theme="dark"] .cwf-badge.is-ok { background: rgba(4, 120, 87, .2); color: #6ee7b7; border-color: rgba(110, 231, 183, .3); }
[data-theme="dark"] .cwf-badge.is-bad { background: rgba(185, 28, 28, .2); color: #fca5a5; border-color: rgba(252, 165, 165, .3); }
[data-theme="dark"] .cwf-link::before { background: #3a362a; }
[data-theme="dark"] .cwf-link i { border-left-color: #5c5540; }
[data-theme="dark"] .cwf-params, [data-theme="dark"] .cwf-basis { border-color: #2c2a22; }
[data-theme="dark"] .cwf-params h2, [data-theme="dark"] .cwf-basis h2 { color: #a8a08d; }
[data-theme="dark"] .cwf-grid input, [data-theme="dark"] .cwf-grid select { background: #1a1812; color: #e7e2d4; border-color: #2c2a22; }
[data-theme="dark"] .cwf-basis li { color: #8a8271; }
[data-theme="dark"] .cwf-basis code { background: #221f17; color: #fbbf24; }
