/* ======================================================================
 * 22 · 智能家居协议怎么选 —— 「协议矩阵控制台」
 * 视觉：靛紫控制台横幅 + 网格矩阵 + 等宽编号；方形卡片、信号点、
 *       青紫双色链路图。与量尺台的薄荷圆点纸面完全不同。
 * ====================================================================== */

.dg3.shp {
    --bg: #f4f3fb;
    --bg2: #e9e7f7;
    --card: #ffffff;
    --card2: #f6f5fd;
    --ink: #1c1b33;
    --ink2: #43406a;
    --muted: #76729b;
    --line: #d7d3ee;
    --line2: #e8e6f6;
    --accent: #5a3fc4;
    --accent-ink: #ffffff;
    --accent-soft: #e9e3ff;
    --accent2: #0d8fa6;
    --accent2-soft: #dff3f8;
    --ok: #127a5c;
    --ok-bg: #dff3ec;
    --warn: #9a6207;
    --warn-bg: #fbf0d9;
    --bad: #b1362b;
    --bad-bg: #fbe7e4;
    --shadow: 0 4px 18px rgba(46, 32, 104, .09);
    --radius: 2px;
    --radius-sm: 2px;
    --font-head: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
    --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, "Courier New", monospace;
    --head-weight: 800;
    --shp-band: #1b1740;
    --shp-band2: #2a2260;
    --shp-cyan: #5fe0e6;
    --shp-violet: #b79cff;

    background:
        linear-gradient(90deg, rgba(90, 63, 196, .035) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(rgba(90, 63, 196, .035) 1px, transparent 1px) 0 0 / 40px 40px,
        var(--bg);
    border-top: 4px solid var(--accent);
}
:root[data-theme="dark"] .dg3.shp {
    --bg: #100f20;
    --bg2: #171532;
    --card: #191734;
    --card2: #211e40;
    --ink: #eae6ff;
    --ink2: #c3bce8;
    --muted: #8f88b8;
    --line: #37325f;
    --line2: #2a2650;
    --accent: #a892ff;
    --accent-ink: #150f35;
    --accent-soft: #30265e;
    --accent2: #57d4dc;
    --accent2-soft: #173c44;
    --ok: #5bc6a4;
    --ok-bg: #18372f;
    --warn: #dcb055;
    --warn-bg: #352a17;
    --bad: #e08076;
    --bad-bg: #3a2220;
    --shadow: 0 4px 20px rgba(0, 0, 0, .45);
    --shp-band: #0c0a1e;
    --shp-band2: #1c1742;
    --shp-cyan: #6ff0f2;
    --shp-violet: #cbb8ff;
    background:
        linear-gradient(90deg, rgba(168, 146, 255, .04) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(rgba(168, 146, 255, .04) 1px, transparent 1px) 0 0 / 40px 40px,
        var(--bg);
}

/* ---------- 首屏控制台：横幅 + 内嵌操作条 ---------- */
.shp-console {
    position: relative; margin: 22px 0 24px;
    background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.shp-console-in {
    position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 260px;
    gap: 18px; align-items: center;
    padding: 26px 28px 24px;
    background: linear-gradient(120deg, var(--shp-band) 0%, var(--shp-band2) 100%);
    color: #f2eeff;
}
.shp-console-grid {
    position: absolute; inset: 0; pointer-events: none; opacity: .3;
    background:
        linear-gradient(90deg, rgba(95, 224, 230, .14) 1px, transparent 1px) 0 0 / 26px 26px,
        linear-gradient(rgba(183, 156, 255, .14) 1px, transparent 1px) 0 0 / 26px 26px;
    mask-image: linear-gradient(90deg, #000, transparent 92%);
}
.shp-console-copy { position: relative; z-index: 1; }
.shp-kicker {
    font: 700 11px var(--font-mono); letter-spacing: .16em; color: var(--shp-cyan);
    margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
}
.shp-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--shp-cyan);
    box-shadow: 0 0 0 4px rgba(95, 224, 230, .18), 0 0 14px var(--shp-cyan);
}
.shp-console h1 { color: #fff; font-size: clamp(28px, 3.5vw, 40px); margin-bottom: 10px; }
.shp-lede { font-size: 14.5px; line-height: 1.88; color: #d8d2f6; max-width: 60em; margin-bottom: 12px; }
.shp-lede b { color: var(--shp-cyan); border-bottom: 1px dashed rgba(95, 224, 230, .6); }
.shp-hero-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.shp-hero-tags span {
    font: 600 11px var(--font-mono); color: var(--shp-violet);
    border: 1px solid rgba(183, 156, 255, .4); border-radius: 2px; padding: 2px 8px;
    background: rgba(183, 156, 255, .08);
}
.shp-topo { width: 100%; max-width: 260px; height: auto; position: relative; z-index: 1; }
.shp-topo rect { fill: rgba(95, 224, 230, .08); stroke: var(--shp-cyan); stroke-width: 1.2; }
.shp-topo rect.mid { fill: rgba(183, 156, 255, .1); stroke: var(--shp-violet); }
.shp-topo .shp-topo-line path { fill: none; stroke: rgba(214, 208, 255, .55); stroke-width: 1.2; stroke-dasharray: 4 3; }
.shp-topo text { fill: #e6e1ff; font: 600 9px var(--font-mono); }
.shp-topo text.tiny { fill: #9d96c9; font-size: 7.5px; }
.shp-topo circle.cloud { fill: var(--shp-cyan); }

.shp-console-bar { padding: 18px 24px 20px; border-top: 2px solid var(--shp-cyan); }
.shp-bar-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 14px; }
.shp .dg3-field > label { font-size: 12.5px; }
.shp .dg3-field .tip { font-size: 11.5px; }
.shp-opts .shp-checks {
    display: flex; gap: 8px; flex-wrap: wrap; min-height: 39px; align-items: center;
    border: 1px solid var(--line); border-radius: var(--radius-sm);
    background: var(--card2); padding: 6px 10px;
}
.shp-opts .checkline { font-size: 12.5px; }
.shp .dg3-btn--main { background: var(--accent); border-radius: 2px; }
.shp-console-bar .dg3-acts { margin-top: 14px; }

/* ---------- 兼容矩阵 ---------- */
.shp-matrix-card { padding: 18px 20px; }
.shp-matrix { font-family: var(--font-mono); font-size: 12.5px; min-width: 760px; }
.shp-matrix th, .shp-matrix td { text-align: center; padding: 8px 6px; }
.shp-matrix th:first-child, .shp-matrix td:first-child { text-align: left; font-family: var(--font-mono); }
.shp-matrix thead th { background: var(--accent-soft); color: var(--accent); font-size: 11.5px; }
:root[data-theme="dark"] .shp-matrix thead th { color: var(--shp-violet); }
.shp-matrix tbody th { background: var(--card2); font-weight: 600; color: var(--ink2); }
.shp-matrix td { font-size: 17px; color: var(--muted); }
.shp-matrix .lv2 { color: var(--ok); font-weight: 700; }
.shp-matrix .lv1 { color: var(--warn); font-weight: 700; }
.shp-matrix .lv0 { color: var(--muted); }
.shp-matrix tr.is-eco > th { background: var(--accent); color: #fff; }
.shp-matrix td.is-picked { background: var(--accent2-soft); box-shadow: inset 0 0 0 2px var(--accent2); }
.shp-matrix-note { margin: 12px 0 0; font-size: 12.5px; line-height: 1.75; color: var(--muted); }
.shp-matrix-note b { color: var(--ink2); }

/* ---------- 结果 ---------- */
.shp-verdict {
    display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center;
    background: var(--accent-soft); border-left: 4px solid var(--accent);
    padding: 14px 16px; border-radius: var(--radius-sm);
}
.shp-verdict strong { display: block; font-size: 17px; color: var(--ink); }
.shp-verdict p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink2); line-height: 1.7; }
.shp-verdict .shp-level {
    font: 800 26px var(--font-mono); color: var(--accent); white-space: nowrap;
}
:root[data-theme="dark"] .shp-verdict .shp-level { color: var(--shp-violet); }
.shp .dg3-kv > div { border-left: 3px solid var(--accent2); }
.shp .dg3-kv dd { color: var(--accent2); font-size: 16px; }
.shp-prelist { margin: 10px 0 0; padding-left: 22px; }
.shp-prelist li { font-size: 13.8px; line-height: 1.85; color: var(--ink2); margin-bottom: 7px; }
.shp-prelist li b { color: var(--accent); }
.shp #shpChecks { display: grid; gap: 8px; }
.shp #shpChecks .dg3-note { font-size: 13.2px; }
.shp-chain {
    display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; margin-top: 10px;
}
.shp-chain .node {
    flex: 1 1 120px; min-width: 110px; background: var(--card2);
    border: 1px solid var(--line); border-top: 2px solid var(--accent2);
    padding: 9px 11px; border-radius: var(--radius-sm);
}
.shp-chain .node b { display: block; font-size: 13px; color: var(--ink); }
.shp-chain .node small { display: block; font-size: 11.5px; color: var(--muted); line-height: 1.55; margin-top: 3px; }
.shp-chain .arrow { align-self: center; color: var(--accent2); font: 700 18px var(--font-mono); }
.shp .shp-batch-ok { color: var(--ok); font-weight: 700; }
.shp .shp-batch-bad { color: var(--bad); font-weight: 700; }
.shp #shpEscape { margin-top: 12px; }

@media (max-width: 900px) {
    .shp-console-in { grid-template-columns: minmax(0, 1fr); }
    .shp-topo { max-width: 220px; }
    .shp-bar-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
    .shp-console-in { padding: 20px 15px; }
    .shp-console-bar { padding: 15px 14px 18px; }
    .shp-bar-grid { grid-template-columns: minmax(0, 1fr); }
    .shp-verdict { grid-template-columns: minmax(0, 1fr); }
    .shp-chain .arrow { transform: rotate(90deg); }
}
