/* ===== 门窗洞口与玻璃面积 · 计算流图 ===== */
.dwg {
    background: #f9fbfd;
    border: 1px solid #dfe8f0;
    border-radius: 10px;
    padding: 24px 22px;
    margin-bottom: 26px;
    box-shadow: 0 8px 26px rgba(40, 70, 100, .06);
}

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

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

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

.dwg-params {
    margin-top: 20px; border-top: 1px solid #dfe8f0; padding-top: 16px;
    display: grid; grid-template-columns: 1fr 190px; gap: 18px; align-items: start;
}
.dwg-params h2 { font-size: 12px; letter-spacing: .08em; color: #5b6b78; margin: 0 0 12px; }
.dwg-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.dwg-grid label { display: flex; flex-direction: column; gap: 4px; }
.dwg-grid span { font-size: 11px; color: #7d8d9b; }
.dwg-grid input, .dwg-grid select {
    font: inherit; font-size: 12.5px; padding: 7px 9px; border: 1px solid #dbe4eb;
    border-radius: 5px; background: #fff; color: #31404f; font-variant-numeric: tabular-nums;
    min-width: 0;
}
.dwg-grid input:focus, .dwg-grid select:focus { outline: 2px solid rgba(3, 105, 161, .18); border-color: #0369a1; }
.dwg-grid input.is-bad { border-color: #dc2626; background: #fef2f2; }

.dwg-window {
    height: 132px; border: 7px solid #9fb3c4; border-radius: 3px;
    background: linear-gradient(160deg, #e0f2fe, #cfe8f7);
    display: flex; overflow: hidden; box-shadow: inset 0 0 12px rgba(60, 90, 120, .12);
}
.dwg-light { flex: 1 1 0; position: relative; }
.dwg-light + .dwg-light { border-left: 6px solid #9fb3c4; }
.dwg-light::after {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(115deg, rgba(255,255,255,.75) 0%, rgba(255,255,255,0) 42%, rgba(255,255,255,.3) 60%, rgba(255,255,255,0) 100%);
}

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

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

/* 深色模式 */
[data-theme="dark"] .dwg { background: #0f1418; border-color: #253038; box-shadow: none; }
[data-theme="dark"] .dwg-node { background: #141b21; border-color: #253038; }
[data-theme="dark"] .dwg-node b { color: #dbe6ee; }
[data-theme="dark"] .dwg-node-tag { color: #7d8d9b; }
[data-theme="dark"] .dwg-node output { color: #7dd3fc; }
[data-theme="dark"] .dwg-node p, [data-theme="dark"] .dwg-node > em { color: #7d8d9b; }
[data-theme="dark"] .dwg-formula { background: #1b252d; color: #93a4b3; }
[data-theme="dark"] .dwg-meta span { color: #7dd3fc; }
[data-theme="dark"] .dwg-node--out { background: #131b21; }
[data-theme="dark"] .dwg-badge { background: #1b252d; border-color: #253038; color: #93a4b3; }
[data-theme="dark"] .dwg-badge.is-ok { background: rgba(4, 120, 87, .2); color: #6ee7b7; border-color: rgba(110, 231, 183, .3); }
[data-theme="dark"] .dwg-badge.is-bad { background: rgba(185, 28, 28, .2); color: #fca5a5; border-color: rgba(252, 165, 165, .3); }
[data-theme="dark"] .dwg-badge.is-warn { background: rgba(217, 119, 6, .18); color: #fcd34d; border-color: rgba(252, 211, 77, .3); }
[data-theme="dark"] .dwg-link::before { background: #2f3c46; }
[data-theme="dark"] .dwg-link i { border-left-color: #4a5b68; }
[data-theme="dark"] .dwg-params, [data-theme="dark"] .dwg-basis { border-color: #253038; }
[data-theme="dark"] .dwg-params h2, [data-theme="dark"] .dwg-basis h2 { color: #93a4b3; }
[data-theme="dark"] .dwg-grid input, [data-theme="dark"] .dwg-grid select { background: #141b21; color: #dbe6ee; border-color: #253038; }
[data-theme="dark"] .dwg-window { border-color: #3d4c58; background: linear-gradient(160deg, #17252f, #12202a); }
[data-theme="dark"] .dwg-light + .dwg-light { border-left-color: #3d4c58; }
[data-theme="dark"] .dwg-basis li { color: #7d8d9b; }
[data-theme="dark"] .dwg-basis code { background: #1b252d; color: #7dd3fc; }
