/* WIRE 工具页 PC 样式（由主样式块抽取；PC 与原先完全一致；H5 追加移动端覆盖） */
:root{--font-ui:"HarmonyOS Sans SC", "MiSans", "Noto Sans SC", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;--font-mono:"JetBrains Mono", "Fira Code", "Source Code Pro", "Liberation Mono", ui-monospace, monospace}
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            -webkit-tap-highlight-color: transparent;
        }

        body {
            background: radial-gradient(circle at 20% 30%, #0b0e16, #07090f);
            font-family: var(--font-ui);
            padding: 20px 16px 40px;
            min-height: 100vh;
            color: #dbe4f3;
        }

        .container {
            max-width: 580px;
            margin: 0 auto;
            position: relative;
        }

        /* ---------- 顶栏 ---------- */
        .aq-topbar {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 14px;
            padding: 0 4px;
        }
        .aq-back {
            display: inline-flex;
            align-items: center;
            gap: 6px;
            color: #9db0a2;
            text-decoration: none;
            font-size: 0.85rem;
            font-weight: 500;
            padding: 8px 14px 8px 10px;
            border-radius: 999px;
            border: 1px solid rgba(34, 197, 94, .28);
            background: rgba(34, 197, 94, .06);
            transition: color .2s, border-color .2s;
        }
        .aq-back svg {
            width: 15px;
            height: 15px;
            stroke: currentColor;
            fill: none;
            stroke-width: 2;
            stroke-linecap: round;
            stroke-linejoin: round;
        }
        .aq-back:active { color: #22c55e; border-color: #22c55e; }
        .aq-name {
            font-size: 0.72rem;
            letter-spacing: .12em;
            color: #5e6f63;
            white-space: nowrap;
        }

        .card {
            background: rgba(10, 20, 30, .92);
            border-radius: 40px;
            border: 1px solid rgba(34, 197, 94, .28);
            box-shadow: 0 0 24px rgba(34, 197, 94, .12), inset 0 0 6px rgba(34, 197, 94, .08);
            padding: 24px 22px 28px;
            margin-top: 6px;
            overflow-wrap: break-word;
        }

        h1 {
            font-size: 1.7rem;
            font-weight: 700;
            background: linear-gradient(135deg, #86efac, #ff9d6b);
            background-clip: text;
            -webkit-background-clip: text;
            color: transparent;
            margin-bottom: 8px;
            letter-spacing: .5px;
        }

        .sub {
            color: #9db0a2;
            font-size: .82rem;
            line-height: 1.7;
            border-left: 3px solid #22c55e;
            padding-left: 12px;
            margin-bottom: 16px;
        }

        /* ---------- 语言切换 ---------- */

        /* ---------- 折叠说明 ---------- */
        details {
            background: rgba(34, 197, 94, .06);
            border: 1px solid rgba(34, 197, 94, .22);
            border-radius: 16px;
            margin-bottom: 18px;
            font-size: .8rem;
            color: #9db0a2;
        }
        summary {
            padding: 13px 16px;
            cursor: pointer;
            font-weight: 600;
            color: #d7f7e4;
            outline: none;
            list-style: none;
        }
        summary::-webkit-details-marker { display: none; }
        details[open] summary { border-bottom: 1px solid rgba(34, 197, 94, .18); }
        .details-content {
            padding: 14px 16px 16px;
            line-height: 1.85;
        }
        .details-content b { color: #4ade80; }

        /* ---------- 模式切换 ---------- */
        .tabs {
            display: flex;
            gap: 8px;
            background: #10141d;
            border: 1px solid rgba(34, 197, 94, .22);
            padding: 6px;
            border-radius: 999px;
            margin-bottom: 16px;
        }
        .tab {
            flex: 1;
            padding: 12px 8px;
            border: 0;
            border-radius: 999px;
            cursor: pointer;
            background: transparent;
            color: #9db0a2;
            font-size: .8rem;
            font-weight: 600;
            font-family: inherit;
            transition: background .2s, color .2s;
            white-space: nowrap;
        }
        .tab.active {
            background: #22c55e;
            color: #04170b;
            box-shadow: 0 0 12px rgba(34, 197, 94, .45);
        }

        .panel.hidden, .hidden { display: none !important; }

        /* ---------- 输入行 ---------- */
        .row {
            display: flex;
            align-items: center;
            gap: 14px;
            margin-bottom: 14px;
            flex-wrap: wrap;
        }
        .row > label {
            width: 138px;
            flex-shrink: 0;
            color: #d7f7e4;
            font-size: .92rem;
            font-weight: 600;
        }
        .input-group {
            display: flex;
            align-items: center;
            gap: 10px;
            flex: 1;
            flex-wrap: wrap;
        }

        input[type=text], input[type=number], select {
            background: #0a1218;
            border: 1px solid rgba(34, 197, 94, .28);
            color: #eaf7ef;
            padding: 13px 16px;
            border-radius: 14px;
            font-size: 16px;
            font-family: inherit;
            outline: none;
            transition: border-color .2s, box-shadow .2s;
            min-width: 0;
        }
        input[type=text]:focus, input[type=number]:focus, select:focus {
            border-color: #22c55e;
            box-shadow: 0 0 0 3px rgba(34, 197, 94, .16);
        }
        input::-webkit-outer-spin-button, input::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
        }
        .input-group input {
            flex: 1;
            font-weight: 600;
            letter-spacing: .5px;
        }
        .input-group select {
            width: 150px;
            font-weight: 600;
            cursor: pointer;
        }

        /* ---------- 参数区 ---------- */
        .cond-title {
            font-size: .72rem;
            color: #6d8273;
            letter-spacing: .2em;
            margin: 4px 0 14px;
            font-weight: 700;
        }
        .grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 14px;
        }
        .field label {
            display: block;
            font-size: .78rem;
            color: #b7c9bd;
            margin-bottom: 8px;
            font-weight: 500;
        }
        .field select, .field input {
            width: 100%;
            font-size: 16px;
            padding: 12px 14px;
            font-weight: 500;
        }
        #tempInfo {
            margin-top: 8px;
            font-size: .76rem;
            color: #4ade80;
            background: rgba(34, 197, 94, .08);
            padding: 8px 12px;
            border-radius: 10px;
            border: 1px dashed rgba(34, 197, 94, .3);
        }

        /* ---------- 按钮 ---------- */
        .btn-group {
            display: flex;
            gap: 10px;
            margin-top: 22px;
            flex-wrap: wrap;
        }
        .btn {
            padding: 15px 18px;
            border: 0;
            border-radius: 16px;
            font-size: .95rem;
            font-weight: 700;
            cursor: pointer;
            text-decoration: none;
            text-align: center;
            font-family: inherit;
            letter-spacing: .5px;
            transition: transform .14s ease-out, background .2s, border-color .2s;
        }
        .btn:active { transform: scale(.98); }
        .btn-primary {
            flex: 2 1 100%;
            background: linear-gradient(135deg, #22c55e, #16a34a);
            color: #04170b;
            box-shadow: 0 8px 22px -12px rgba(34, 197, 94, .8);
        }
        .btn-secondary {
            flex: 1 1 40%;
            background: #10141d;
            border: 1px solid rgba(34, 197, 94, .28);
            color: #d7f7e4;
            font-weight: 600;
        }
        .btn-secondary:active {
            background: rgba(34, 197, 94, .12);
            border-color: #22c55e;
            color: #22c55e;
        }

        /* ---------- 结果 ---------- */
        .result-head {
            display: flex;
            align-items: baseline;
            gap: 8px;
            flex-wrap: wrap;
            margin-bottom: 14px;
        }
        .result-head h2 {
            font-size: 1.3rem;
            margin: 0;
            color: #fff;
            line-height: 1.45;
            font-weight: 700;
        }
        .result-head h2 span { color: #22c55e; }

        .result-sub {
            font-size: .78rem;
            color: #8fa396;
            line-height: 1.7;
            margin: -4px 0 16px;
        }

        /* 并联根数控制区 */
        .dyn {
            background: rgba(34, 197, 94, .07);
            border: 1px solid rgba(34, 197, 94, .26);
            border-radius: 18px;
            padding: 16px 18px;
            margin-bottom: 18px;
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            justify-content: space-between;
            gap: 12px 16px;
        }
        .dyn-q {
            flex: 1 1 210px;
            min-width: 0;
            font-size: .84rem;
            color: #d7f7e4;
            line-height: 1.6;
        }
        .dyn-q b { color: #4ade80; font-size: 1.1rem; margin: 0 4px; }
        .dyn-ctrl {
            display: flex;
            align-items: center;
            gap: 8px;
            flex: 0 1 auto;
            flex-wrap: nowrap;
        }
        .dyn-ctrl .pre,
        .dyn-ctrl .suf {
            font-size: .82rem;
            color: #b7c9bd;
        }
        .dyn-ctrl input {
            width: 68px;
            height: 44px;
            padding: 0;
            text-align: center;
            font-size: 16px;
            font-weight: 700;
            background: #0a1218;
            border: 1px solid #22c55e;
            border-radius: 12px;
            color: #fff;
            outline: none;
        }
        .dyn-ctrl input:focus {
            box-shadow: 0 0 0 3px rgba(34, 197, 94, .18);
        }
        .btn-confirm {
            height: 44px;
            padding: 0 16px;
            border: 0;
            border-radius: 12px;
            background: #22c55e;
            color: #04170b;
            font-size: .82rem;
            font-weight: 700;
            font-family: inherit;
            cursor: pointer;
            white-space: nowrap;
            transition: background .2s, transform .14s ease-out;
        }
        .btn-confirm:active { background: #4ade80; transform: scale(.97); }

        .search-tip {
            background: rgba(34, 197, 94, .08);
            border: 1px dashed rgba(34, 197, 94, .38);
            padding: 12px 14px;
            border-radius: 14px;
            color: #4ade80;
            font-size: .8rem;
            line-height: 1.7;
            margin-bottom: 16px;
        }
        .search-tip b { color: #d7f7e4; }

        .formula-box {
            background: rgba(251, 191, 36, .08);
            border: 1px solid rgba(251, 191, 36, .26);
            padding: 12px 14px;
            border-radius: 14px;
            margin-bottom: 16px;
            font-size: .8rem;
            line-height: 1.75;
            color: #fbbf24;
        }
        .formula-box b { color: #fff; }

        .metrics {
            display: grid;
            grid-template-columns: 1fr;
            gap: 10px;
            margin-bottom: 16px;
        }
        .metric {
            background: #0a1218;
            border: 1px solid rgba(34, 197, 94, .18);
            border-radius: 16px;
            padding: 14px 16px 14px 18px;
            position: relative;
            overflow: hidden;
        }
        .metric::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            bottom: 0;
            width: 3px;
        }
        .metric.peak::before { background: #ff9d6b; }
        .metric.stable::before { background: #4ade80; }
        .metric.rec::before { background: #22d3ee; }
        .metric.parallel::before { background: #a78bfa; }
        .m-label { font-size: .76rem; color: #8fa396; margin-bottom: 6px; }
        .m-value {
            font-size: 1.6rem;
            font-weight: 800;
            line-height: 1.1;
            letter-spacing: -.5px;
        }
        .metric.peak .m-value { color: #ff9d6b; }
        .metric.stable .m-value { color: #4ade80; }
        .metric.rec .m-value { color: #22d3ee; }
        .metric.parallel .m-value { color: #a78bfa; }
        .m-unit { font-size: .8rem; font-weight: 600; margin-left: 3px; opacity: .75; }
        .m-note { font-size: .72rem; color: #6d8273; margin-top: 6px; line-height: 1.6; }

        .info-list { display: flex; flex-direction: column; gap: 9px; }
        .info-item {
            display: flex;
            gap: 9px;
            font-size: .8rem;
            line-height: 1.7;
            color: #b7c9bd;
            align-items: flex-start;
        }
        .dot {
            width: 7px;
            height: 7px;
            border-radius: 50%;
            margin-top: 7px;
            flex-shrink: 0;
            background: #4a6080;
        }
        .dot.ok { background: #4ade80; }
        .dot.warn { background: #fbbf24; }
        .dot.bad { background: #f87171; }

        .alt-box {
            background: rgba(34, 211, 238, .05);
            border: 1px solid rgba(34, 211, 238, .2);
            border-radius: 16px;
            padding: 14px 16px;
            margin-top: 12px;
        }
        .alt-box h4 {
            margin: 0 0 8px;
            font-size: .8rem;
            color: #22d3ee;
            font-weight: 700;
        }
        .alt-line { font-size: .8rem; color: #b7c9bd; line-height: 1.8; }
        .alt-line b { color: #eaf7ef; }

        .err, .err-box {
            color: #f87171;
            font-size: .82rem;
            font-weight: 600;
            line-height: 1.7;
            padding: 14px 16px;
            background: rgba(248, 113, 113, .08);
            border: 1px solid rgba(248, 113, 113, .28);
            border-radius: 14px;
            margin-bottom: 14px;
        }

        .tool-foot {
            text-align: center;
            color: #4d5f54;
            font-size: .72rem;
            line-height: 1.9;
            margin-top: 22px;
        }

        /* ---------- 手机 ---------- */
        @media (max-width: 560px) {
            .card { padding: 20px 16px 24px; border-radius: 32px; }
            h1 { font-size: 1.4rem; }
            .row > label { width: 100%; margin-bottom: -4px; font-size: .9rem; }
            .input-group { width: 100%; }
            .input-group input { width: 100%; }
            .input-group select { width: 100%; }
            .dyn {
                padding: 14px 16px;
                flex-direction: column;
                align-items: stretch;
                gap: 12px;
            }
            .dyn-q { flex: none; }
            .dyn-ctrl { flex: 1 1 auto; justify-content: space-between; }
            .btn-confirm { flex: 1 1 auto; }
            .btn-group { flex-direction: column; }
            .btn-primary, .btn-secondary { flex: 1 1 100%; width: 100%; }
            .result-head h2 { font-size: 1.1rem; }
        }
