/* ===== 土方开挖与回填 · 计算流图 ===== */
.ews {
    background: #fdfbf6;
    border: 1px solid #ece4d4;
    border-radius: 10px;
    padding: 24px 22px;
    margin-bottom: 26px;
    box-shadow: 0 8px 26px rgba(96, 74, 40, .06);
}

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

.ews-link { flex: 0 0 34px; display: flex; align-items: center; justify-content: center; position: relative; }
.ews-link::before {
    content: ''; position: absolute; left: 4px; right: 8px; top: 50%;
    height: 1px; background: #ded4bf;
}
.ews-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;
}

.ews-node--out { background: #fffdf6; }
.ews-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;
}
.ews-badge.is-ok { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.ews-badge.is-bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.ews-badge.is-warn { background: #fffbeb; color: #92400e; border-color: #fde68a; }

.ews-params { margin-top: 20px; border-top: 1px solid #ece4d4; padding-top: 16px; }
.ews-params h2 { font-size: 12px; letter-spacing: .08em; color: #6b6555; margin: 0 0 12px; }
.ews-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.ews-grid label { display: flex; flex-direction: column; gap: 4px; }
.ews-grid span { font-size: 11px; color: #8a8271; }
.ews-grid input, .ews-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;
    min-width: 0;
}
.ews-grid input:focus, .ews-grid select:focus { outline: 2px solid rgba(161, 98, 7, .2); border-color: #a16207; }
.ews-grid input.is-bad { border-color: #dc2626; background: #fef2f2; }

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

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

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