/* ===== 屋面雨水管数量与管径 · 计算流图 ===== */
.rds {
    background: #f8fbfd;
    border: 1px solid #dbe7f0;
    border-radius: 10px;
    padding: 24px 22px;
    margin-bottom: 26px;
    box-shadow: 0 8px 26px rgba(30, 70, 110, .06);
}

.rds-flow { display: flex; align-items: stretch; gap: 0; }
.rds-node {
    flex: 1 1 0; min-width: 0;
    background: #fff; border: 1px solid #dbe7f0; border-radius: 8px;
    padding: 13px 14px 12px; display: flex; flex-direction: column; gap: 5px;
    position: relative;
}
.rds-node b { font-size: 12.5px; color: #2c3e4f; line-height: 1.3; }
.rds-node-tag {
    font-size: 9.5px; letter-spacing: .1em; color: #93a6b6;
    text-transform: uppercase;
}
.rds-node output {
    font-size: 30px; line-height: 1; color: #1d4ed8;
    font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
    font-variant-numeric: tabular-nums; font-weight: 700;
}
.rds-node output.rds-out-sm { font-size: 21px; }
.rds-node > em { font-style: normal; font-size: 10px; color: #93a6b6; margin-top: -2px; }
.rds-node p { margin: 2px 0 0; font-size: 10.5px; line-height: 1.55; color: #7d8d9b; }
.rds-formula {
    font-family: ui-monospace, monospace; font-size: 10px; color: #7d8d9b;
    background: #edf4f9; border-radius: 4px; padding: 3px 6px; align-self: flex-start;
}
.rds-meta { font-family: ui-monospace, monospace; }
.rds-meta span { color: #1e40af; font-weight: 700; }

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

.rds-node--out { background: #f6fdfb; }
.rds-badge {
    margin-top: 2px; display: inline-block; align-self: flex-start;
    font-size: 12px; font-weight: 700; padding: 4px 10px; border-radius: 3px;
    background: #edf2f5; color: #5b6b78; border: 1px solid #d9e3ea;
}
.rds-badge.is-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.rds-badge.is-bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.rds-badge.is-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.rds-params { margin-top: 20px; border-top: 1px solid #dbe7f0; padding-top: 16px; }
.rds-params h2 { font-size: 12px; letter-spacing: .08em; color: #5b6b78; margin: 0 0 12px; }
.rds-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.rds-grid label { display: flex; flex-direction: column; gap: 4px; }
.rds-grid span { font-size: 11px; color: #7d8d9b; }
.rds-grid input, .rds-grid select {
    font: inherit; font-size: 12.5px; padding: 7px 9px; border: 1px solid #d9e3ea;
    border-radius: 5px; background: #fff; color: #2c3e4f; font-variant-numeric: tabular-nums;
    min-width: 0;
}
.rds-grid input:focus, .rds-grid select:focus { outline: 2px solid rgba(29, 78, 216, .16); border-color: #1d4ed8; }
.rds-grid input.is-bad { border-color: #dc2626; background: #fef2f2; }

.rds-basis { margin-top: 18px; border-top: 1px dashed #d9e3ea; padding-top: 14px; }
.rds-basis h2 { font-size: 12px; color: #5b6b78; margin: 0 0 8px; letter-spacing: .06em; }
.rds-basis ul { margin: 0; padding-left: 18px; }
.rds-basis li { font-size: 11.5px; line-height: 1.8; color: #7d8d9b; }
.rds-basis code { background: #edf4f9; padding: 1px 4px; color: #1e40af; }

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

/* 深色模式 */
[data-theme="dark"] .rds { background: #0e1318; border-color: #232d36; box-shadow: none; }
[data-theme="dark"] .rds-node { background: #131a21; border-color: #232d36; }
[data-theme="dark"] .rds-node b { color: #dae5ee; }
[data-theme="dark"] .rds-node-tag { color: #7d8d9b; }
[data-theme="dark"] .rds-node output { color: #93c5fd; }
[data-theme="dark"] .rds-node p, [data-theme="dark"] .rds-node > em { color: #7d8d9b; }
[data-theme="dark"] .rds-formula { background: #1a232b; color: #93a6b6; }
[data-theme="dark"] .rds-meta span { color: #93c5fd; }
[data-theme="dark"] .rds-node--out { background: #111a1f; }
[data-theme="dark"] .rds-badge { background: #1a232b; border-color: #232d36; color: #93a6b6; }
[data-theme="dark"] .rds-badge.is-ok { background: rgba(4, 120, 87, .2); color: #6ee7b7; border-color: rgba(110, 231, 183, .3); }
[data-theme="dark"] .rds-badge.is-bad { background: rgba(185, 28, 28, .2); color: #fca5a5; border-color: rgba(252, 165, 165, .3); }
[data-theme="dark"] .rds-badge.is-warn { background: rgba(217, 119, 6, .18); color: #fcd34d; border-color: rgba(252, 211, 77, .3); }
[data-theme="dark"] .rds-link::before { background: #2c3946; }
[data-theme="dark"] .rds-link i { border-left-color: #4a5b68; }
[data-theme="dark"] .rds-params, [data-theme="dark"] .rds-basis { border-color: #232d36; }
[data-theme="dark"] .rds-params h2, [data-theme="dark"] .rds-basis h2 { color: #93a6b6; }
[data-theme="dark"] .rds-grid input, [data-theme="dark"] .rds-grid select { background: #131a21; color: #dae5ee; border-color: #232d36; }
[data-theme="dark"] .rds-basis li { color: #7d8d9b; }
[data-theme="dark"] .rds-basis code { background: #1a232b; color: #93c5fd; }
