:root {
    --primary: #2b6cff;
    --primary-dark: #1f55d6;
    --bg: #eef1f6;
    --panel: #fff;
    --border: #e3e8f0;
    --text: #1f2733;
    --text-light: #6b7686;
    --accent: #00a870;
    --danger: #e4393c;
    --radius: 10px;
    --shadow: 0 2px 12px rgba(31, 85, 214, 0.07);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
.link { color: var(--primary); }
.link:hover { text-decoration: underline; }
.muted { color: var(--text-light); font-size: 12px; }

/* 顶栏 */
.topbar { height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 24px; position: sticky; top: 0; z-index: 50; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { font-weight: 800; color: var(--primary); font-size: 18px; letter-spacing: 1px; }
.brand-name { font-size: 15px; color: var(--text); font-weight: 600; padding-left: 10px; border-left: 1px solid var(--border); }
.topnav { display: flex; gap: 6px; margin-left: 40px; }
.topnav a { padding: 8px 16px; border-radius: 8px; color: var(--text-light); font-size: 14px; }
.topnav a:hover { background: #f2f6fd; color: var(--primary); }
.topnav a.active { background: var(--primary); color: #fff; }
.topuser { margin-left: auto; display: flex; align-items: center; gap: 8px; color: var(--text-light); font-size: 13px; position: relative; }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; object-fit: cover; }
.avatar.img { background: #eef2f7; }
.user-menu-wrap { position: relative; }
.user-menu-trigger { display: flex; align-items: center; gap: 8px; background: transparent; border: 1px solid transparent; border-radius: 20px; padding: 4px 10px 4px 4px; cursor: pointer; color: var(--text); font-size: 13px; }
.user-menu-trigger:hover { background: #f2f6fd; border-color: var(--border); }
.user-menu-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu-caret { font-size: 10px; color: var(--text-light); }
.user-dropdown { display: none; position: absolute; right: 0; top: calc(100% + 6px); min-width: 160px; background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 8px 24px rgba(15,23,42,.12); padding: 6px; z-index: 100; }
.user-dropdown.open { display: block; }
.user-dropdown-item { display: block; width: 100%; text-align: left; padding: 10px 12px; border: none; background: transparent; border-radius: 8px; font-size: 13px; color: var(--text); cursor: pointer; text-decoration: none; }
.user-dropdown-item:hover { background: #f2f6fd; color: var(--primary); }
.user-dropdown-item.danger { color: var(--danger); }
.user-dropdown-item.danger:hover { background: #fff5f5; color: var(--danger); }
.user-dropdown-divider { height: 1px; background: var(--border); margin: 4px 6px; }

/* 个人资料 */
.profile-page .profile-layout { max-width: 720px; }
.profile-card { padding: 28px; }
.profile-head { display: flex; align-items: center; gap: 20px; margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border); }
.profile-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-avatar-img, .profile-avatar-letter { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; }
.profile-avatar-letter { background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 32px; font-weight: 600; }
.profile-meta h2 { margin: 0 0 4px; font-size: 20px; }
.profile-meta .muted { margin: 0; color: var(--text-light); font-size: 13px; }
.profile-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.profile-form-grid .span2 { grid-column: span 2; }
.profile-form-grid .req, .user-form-grid .req { color: #e4393c; }
.profile-section-title { margin-top: 8px; padding-top: 8px; border-top: 1px solid #e8eef5; }
.profile-section-title h4 { margin: 0 0 6px; font-size: 15px; color: #0f172a; }
.quote-brand-preview {
    border: 1px solid #dbe3ef; border-radius: 12px; background: #fff; padding: 18px 20px 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.6);
}
.quote-brand-preview .qbp-head {
    display: flex; justify-content: space-between; gap: 16px;
    border-bottom: 3px solid #2b6cff; padding-bottom: 12px; margin-bottom: 14px;
}
.quote-brand-preview .qbp-co { font-size: 18px; font-weight: 700; color: #2b6cff; line-height: 1.3; }
.quote-brand-preview .qbp-sub { margin-top: 4px; font-size: 12px; color: #888; }
.quote-brand-preview .qbp-right { font-size: 12px; color: #666; line-height: 1.7; text-align: right; }
.quote-brand-preview .qbp-title {
    text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 2px; color: #222;
}
.quote-brand-preview .qbp-tip {
    margin: 12px 0 0; font-size: 12px; color: #94a3b8; text-align: center;
}
.profile-pwd-section h4 { margin: 0 0 4px; font-size: 14px; }
.profile-actions { margin-top: 20px; display: flex; justify-content: flex-end; }
.modal.modal-sm { max-width: 400px; }
.modal.modal-sm .modal-body {
    display: flex; flex-direction: column; gap: 10px; grid-template-columns: none;
}
.sys-decoy {
    position: absolute; left: -10000px; top: auto; width: 1px; height: 1px;
    opacity: 0; overflow: hidden; pointer-events: none;
}

/* 页面通用 */
.page { max-width: 1640px; margin: 20px auto; padding: 0 28px; }
.crumb { font-size: 13px; color: var(--text-light); margin-bottom: 14px; }
.crumb b { color: var(--text); }
.crumb a { color: var(--primary); }
.card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 18px; }
.sec-title { font-size: 14px; font-weight: 600; margin: 18px 0 12px; padding-left: 10px; border-left: 3px solid var(--primary); }
.empty { text-align: center; color: var(--text-light); padding: 40px 0; }

/* 按钮 */
.btn-primary { height: 36px; padding: 0 18px; background: var(--primary); color: #fff; border: none; border-radius: 8px; font-size: 14px; cursor: pointer; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-ghost { height: 36px; padding: 0 16px; background: #fff; color: var(--primary); border: 1px solid var(--primary); border-radius: 8px; font-size: 14px; cursor: pointer; }
a.btn-ghost { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; box-sizing: border-box; }
.btn-ghost:hover { background: rgba(43,108,255,.06); }
.mini { height: 28px; padding: 0 10px; background: #fff; border: 1px solid var(--border); border-radius: 6px; font-size: 12px; cursor: pointer; color: var(--text); margin: 0 2px; }
.mini:hover { border-color: var(--primary); color: var(--primary); }
.mini.danger { color: var(--danger); border-color: #fecaca; }
.mini.danger:hover { border-color: var(--danger); background: #fff5f5; }

input, select, textarea { font-family: inherit; }
input[type=text],
input[type=number],
input[type=password],
input[type=search],
input[type=tel],
input[type=email],
input:not([type]),
select {
    height: 38px; padding: 0 14px; border: 1px solid transparent; border-radius: 10px;
    font-size: 14px; color: var(--text); background: #f3f5f9; width: 100%;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
textarea {
    width: 100%; min-height: 84px; padding: 10px 14px; border: 1px solid transparent;
    border-radius: 10px; font-size: 14px; color: var(--text); background: #f3f5f9; resize: vertical;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
input[type=text]::placeholder, input[type=number]::placeholder, input[type=password]::placeholder,
textarea::placeholder { color: #9aa7b8; }
input[type=text]:hover, input[type=number]:hover, input[type=password]:hover,
input[type=search]:hover, select:hover, textarea:hover { background: #eef1f6; }
input:focus, select:focus, textarea:focus {
    outline: none; background: #fff; border-color: #93b4ff;
    box-shadow: 0 0 0 3px rgba(43,108,255,.14);
}
input[readonly], input:disabled, textarea:disabled, select:disabled {
    background: #eef1f6; color: #94a3b8; box-shadow: none; border-color: transparent;
}
input.mini { height: 28px; width: auto; padding: 0 8px; font-size: 12px; border-radius: 6px; }
input::-ms-reveal, input::-ms-clear { display: none; }
.form-field label { display: block; font-size: 13px; color: #64748b; font-weight: 500; margin-bottom: 8px; }
.form-field label.fld-lab,
.form-field .master-sel-lab {
    display: flex; align-items: center; gap: 4px;
}
.help-tip {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px; height: 16px;
    flex-shrink: 0;
    cursor: help;
    outline: none;
    vertical-align: middle;
}
.help-tip i {
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #c5cad3;
    color: #fff;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    display: block;
    transition: background .15s ease;
}
.help-tip:hover i,
.help-tip:focus i {
    background: #f59e0b;
}
.help-tip-pop {
    position: fixed;
    z-index: 220;
    min-width: 168px;
    max-width: 280px;
    padding: 8px 12px;
    background: #fff;
    color: #334155;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.55;
    border-radius: 6px;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .16);
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .12s ease;
    white-space: normal;
    text-align: left;
}
.help-tip:hover .help-tip-pop,
.help-tip:focus .help-tip-pop {
    opacity: 1;
    visibility: visible;
}
.help-tip-pop::after {
    content: '';
    position: absolute;
    left: var(--arrow-x, 50%);
    bottom: -6px;
    width: 0; height: 0;
    margin-left: -6px;
    border: 6px solid transparent;
    border-top-color: #fff;
    border-bottom-width: 0;
}
.help-tip-pop.is-below::after {
    bottom: auto;
    top: -6px;
    border-top-color: transparent;
    border-bottom-color: #fff;
    border-top-width: 0;
    border-bottom-width: 6px;
}

.modal.modal-prod { width: 760px; }
.io-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.io-col {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    background: #f8fafc;
    min-width: 0;
}
.io-col-head {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text);
    margin-bottom: 8px;
}
.io-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 18px;
    padding: 0 5px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
}
.io-badge.in { background: #dbeafe; color: #1d4ed8; }
.io-badge.out { background: #dcfce7; color: #15803d; }
.io-col .cap-row { background: #fff; }
.io-col .cap-empty { padding: 4px 0; }
.io-col .cap-qty-lab .cap-res { min-width: 0; max-width: 100%; }

/* 列表 */
.list-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.list-toolbar .search { max-width: 280px; }
.list-toolbar .spacer { flex: 1; }
table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--border); padding: 10px 12px; text-align: center; }
table.grid th { background: #f7f9fd; color: var(--text); font-weight: 600; }
table.grid td.l, table.grid th.l { text-align: left; }
table.grid tr:hover td { background: #fafcff; }
table.grid th.col-note, table.grid td.col-note {
    width: 96px; max-width: 96px; text-align: left;
}
table.grid td.col-note span {
    display: block; max-width: 96px; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap;
}

/* 后台产品列表 */
.admin-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
}
table.grid.admin-prod-grid {
    font-size: 13px;
    table-layout: auto;
    min-width: 960px;
}
table.grid.admin-prod-grid thead th {
    white-space: nowrap;
    font-size: 12px;
    padding: 9px 10px;
    vertical-align: middle;
}
table.grid.admin-prod-grid tbody td {
    padding: 10px 12px;
    vertical-align: middle;
    height: 48px;
}
table.grid.admin-prod-grid tbody td > * {
    vertical-align: middle;
}
table.grid.admin-prod-grid .col-model {
    min-width: 68px;
    white-space: nowrap;
    font-weight: 650;
    color: var(--primary);
}
table.grid.admin-prod-grid .col-name {
    min-width: 120px;
    max-width: 180px;
    text-align: left;
}
table.grid.admin-prod-grid .name-clip {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
table.grid.admin-prod-grid .col-spec {
    min-width: 148px;
    text-align: left;
}
table.grid.admin-prod-grid .spec-line {
    font-size: 13px;
    line-height: 1.45;
    white-space: nowrap;
}
table.grid.admin-prod-grid .spec-muted {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-light);
    line-height: 1.4;
    white-space: nowrap;
}
table.grid.admin-prod-grid .cell-tag {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 12px;
    background: #f1f5f9;
    color: #475569;
    white-space: nowrap;
}
table.grid.admin-prod-grid .cell-tag.ok {
    background: #ecfdf5;
    color: #047857;
}
table.grid.admin-prod-grid .cell-tag.form {
    background: #eef3fe;
    color: var(--primary);
}
table.grid.admin-prod-grid .col-cascade,
table.grid.admin-prod-grid .col-form,
table.grid.admin-prod-grid .col-splice {
    white-space: nowrap;
}
table.grid.admin-prod-grid .col-ifaces {
    min-width: 200px;
    max-width: 280px;
}
table.grid.admin-prod-grid .iface-tags {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    gap: 4px;
}
table.grid.admin-prod-grid .iface-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    max-width: 100%;
    padding: 2px 8px 2px 4px;
    border-radius: 4px;
    font-size: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
table.grid.admin-prod-grid .iface-tag em {
    font-style: normal;
    font-size: 10px;
    font-weight: 650;
    padding: 1px 5px;
    border-radius: 3px;
    background: #dbeafe;
    color: #1d4ed8;
}
table.grid.admin-prod-grid .iface-tag.out em {
    background: #dcfce7;
    color: #15803d;
}
table.grid.admin-prod-grid .col-price {
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
table.grid.admin-prod-grid th.col-note,
table.grid.admin-prod-grid td.col-note {
    width: auto;
    max-width: 140px;
    min-width: 88px;
    text-align: left;
}
table.grid.admin-prod-grid td.col-note span {
    max-width: 140px;
}
table.grid.admin-prod-grid .col-sticky-l {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #fff;
    box-shadow: 1px 0 0 var(--border);
}
table.grid.admin-prod-grid thead .col-sticky-l,
table.grid.admin-prod-grid thead .col-sticky-r {
    background: #f7f9fd;
    z-index: 3;
}
table.grid.admin-prod-grid .col-sticky-r {
    position: sticky;
    right: 0;
    z-index: 2;
    background: #fff;
    box-shadow: -1px 0 0 var(--border);
}
table.grid.admin-prod-grid td.ops {
    display: table-cell;
    vertical-align: middle;
    white-space: nowrap;
    width: 1%;
    text-align: center;
}
table.grid.admin-prod-grid .ops-btns {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    white-space: nowrap;
    vertical-align: middle;
}
table.grid.admin-prod-grid tr:hover td.col-sticky-l,
table.grid.admin-prod-grid tr:hover td.col-sticky-r {
    background: #fafcff;
}

.tag-led { background: rgba(43,108,255,.1); color: var(--primary); padding: 2px 8px; border-radius: 4px; font-size: 12px; }
.ops { white-space: nowrap; }

/* 编辑页 */
.edit-head { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 20px; display: flex; align-items: center; margin-bottom: 16px; box-shadow: var(--shadow); }
.edit-head .back { color: var(--primary); margin-right: 14px; }
.ehd-title { font-weight: 600; font-size: 15px; }
.ehd-ops { margin-left: auto; display: flex; gap: 8px; }
.edit-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 18px; align-items: stretch; }
.edit-form {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 22px; height: 100%;
}
.edit-form .blk:last-child { margin-bottom: 0; }
.blk { margin-bottom: 26px; }
.blk h4 { font-size: 15px; color: var(--primary); margin-bottom: 16px; display: flex; align-items: center; }
.blk h4 i { width: 22px; height: 22px; background: var(--primary); color: #fff; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 13px; margin-right: 8px; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.seg.seg-lg { width: 100%; margin-bottom: 18px; }
.seg button { flex: 1; border: none; background: #fff; padding: 10px 18px; font-size: 14px; cursor: pointer; color: var(--text-light); }
.seg button.active { background: var(--primary); color: #fff; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.fld label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.fld.inline { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; max-width: 280px; }
.fld.inline label { margin-bottom: 0; white-space: nowrap; }

.eq-row { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 14px; }
.eq-cell { flex: 1; position: relative; display: flex; align-items: center; }
.eq-cell label { position: absolute; top: -20px; left: 0; font-size: 13px; color: var(--text-light); white-space: nowrap; }
.eq-cell .pfx { display: none; }
.eq-cell input { padding-left: 10px; padding-right: 30px; text-align: left; }
.eq-cell .sfx { position: absolute; right: 8px; color: var(--text-light); font-size: 12px; pointer-events: none; }
.eq-row .op { font-size: 18px; color: var(--text-light); padding-bottom: 7px; }

.calc-summary { display: flex; flex-wrap: wrap; gap: 8px 26px; background: #f7f9fd; border-radius: 8px; padding: 14px 16px; font-size: 13px; color: var(--text-light); }
.calc-summary b { color: var(--primary); font-size: 15px; }

.edit-preview {
    display: flex; flex-direction: column;
    height: 0; min-height: 100%;
}
.preview-card {
    display: flex; flex-direction: column; flex: 1; min-height: 0;
    height: 100%; margin-bottom: 0; overflow: hidden;
}
.preview-card h4 { font-size: 14px; color: var(--primary); margin-bottom: 12px; }
.preview-wrap {
    background: #f7f8fb; border-radius: 10px; padding: 14px 12px 24px;
    display: flex; align-items: center; justify-content: center;
    flex: 1 1 0; min-height: 0; overflow: hidden;
}
.preview-stage { display: flex; align-items: flex-end; gap: 10px; justify-content: center; max-width: 100%; }
.preview-stage #previewCanvas {
    display: block; flex-shrink: 0; max-width: none;
}
#previewCanvas { max-width: none; }

/* 报价区 */
.plan-panel h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-left: 10px; border-left: 3px solid var(--primary); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 4px; background: rgba(0,168,112,.1); color: var(--accent); font-size: 12px; font-weight: 600; }
.plan-toolbar { display: flex; align-items: center; gap: 16px; margin-bottom: 12px; flex-wrap: wrap; }
.plan-toolbar label { font-size: 13px; color: var(--text-light); display: inline-flex; align-items: center; gap: 6px; }
.plan-toolbar select, .plan-toolbar input[type=text] { width: auto; min-width: 110px; height: 34px; }
.card-summary { font-size: 13px; color: var(--text); margin-bottom: 12px; }
.card-summary b { color: var(--primary); }
.table-wrap { overflow-x: auto; }
.quote-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.quote-table th, .quote-table td { border: 1px solid var(--border); padding: 8px 10px; text-align: center; white-space: nowrap; }
.quote-table th { background: #f2f6fd; font-weight: 600; }
.quote-table td.left { text-align: left; white-space: normal; }
.quote-table input { width: 84px; height: 30px; text-align: right; padding: 0 8px; }
.quote-table .subtotal { font-weight: 600; color: var(--primary); }
.cat-tag { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 12px; background: #eef3fe; color: var(--primary); }
.quote-total { text-align: right; margin-top: 14px; font-size: 15px; }
.quote-total b { font-size: 22px; color: var(--danger); margin-left: 8px; }
.hint { font-size: 12px; color: var(--text-light); margin-top: 8px; }
.hint.warn { color: #dc2626; font-weight: 500; }
.hint-inline { font-size: 12px; color: var(--text-light); margin-left: 8px; }

/* 查看页信息网格 */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.info-item { display: flex; border-bottom: 1px solid var(--border); }
.info-item:nth-child(odd) { border-right: 1px solid var(--border); }
.info-item .k { width: 120px; background: #f7f9fd; padding: 10px 12px; color: var(--text-light); font-size: 13px; }
.info-item .v { padding: 10px 12px; flex: 1; }
.view-head { display: flex; align-items: flex-start; margin-bottom: 6px; }
.view-head .head-ops { margin-left: auto; }

/* 后台管理 */
.admin-layout { display: grid; grid-template-columns: 280px 1fr; gap: 18px; align-items: start; }
.admin-menu {
    background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 10px; display: flex; flex-direction: column; min-height: 480px;
}
.adm-tree-head {
    font-size: 12px; color: #8a94a6; font-weight: 650; padding: 4px 8px 8px; letter-spacing: .4px;
}
.cat-tree-search { width: 100%; height: 34px; margin-bottom: 8px; }
.adm-tree { margin-bottom: 6px; flex: 1; overflow-y: auto; max-height: calc(100vh - 300px); }
.cat-tree-empty { padding: 8px 10px; }
.cat-tree-row {
    display: flex; align-items: center; gap: 2px;
    padding-left: calc(4px + var(--d, 0) * 14px);
    border-radius: 8px; margin-bottom: 1px;
}
.cat-tree-row:hover { background: #f7f8fb; }
.cat-tree-row.on { background: #fff1e6; }
.cat-twist, .cat-twist-ph {
    width: 18px; height: 28px; flex-shrink: 0; border: none; background: none;
    color: #94a3b8; cursor: pointer; padding: 0; font-size: 9px; line-height: 28px; text-align: center;
}
.cat-twist:hover { color: #e67a2e; }
.cat-twist-ph { cursor: default; }
.cat-more {
    width: 28px; height: 28px; flex-shrink: 0; border: none; background: transparent;
    color: #94a3b8; border-radius: 6px; cursor: pointer; font-size: 16px; line-height: 1; opacity: 0;
}
.cat-tree-row:hover .cat-more, .cat-tree-row.on .cat-more { opacity: 1; }
.cat-more:hover { background: #ffe8d4; color: #e67a2e; }
.adm-cat-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-master-tag {
    flex-shrink: 0; font-size: 11px; line-height: 1; padding: 2px 5px; border-radius: 4px;
    background: #fff4e8; color: #d46b08; margin-left: 4px;
}
.cat-tree-row.on .cat-master-tag { background: #ffe0c4; }
.cat-tree-actions { display: flex; gap: 6px; margin: 6px 0 8px; }
.cat-tree-actions .mini { flex: 1; height: 32px; }
.cat-pop {
    position: fixed; z-index: 120; background: #fff; border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,38,.14); min-width: 148px; padding: 6px 0;
}
.cat-pop button {
    display: block; width: 100%; text-align: left; border: none; background: none;
    padding: 8px 14px; font-size: 13px; cursor: pointer; color: var(--text);
}
.cat-pop button:hover { background: #fff4e8; color: #e67a2e; }
.cat-pop button.danger { color: var(--danger); }
.cat-pop button.danger:hover { background: #fef2f2; }
.cat-pop button:disabled { opacity: .35; cursor: not-allowed; }
.adm-cat-tools { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.adm-cat-title { min-width: 0; }
.adm-cat-title h3 { margin: 0; }
.adm-cat-title .muted { font-size: 12px; display: block; margin-top: 2px; }
.master-link-bar {
    display: flex; align-items: flex-start; gap: 8px; padding: 10px 12px;
    background: #f7f9fd; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 12px;
}
.master-link-bar.on { background: #fff7ee; border-color: #f3d0ae; }
.master-link-bar .master-sel-lab { align-items: flex-start; gap: 8px; font-size: 13px; }
.master-link-bar input { margin-top: 2px; }
.master-link-bar b { display: block; font-size: 13px; }
.master-link-bar em { display: block; font-style: normal; font-size: 12px; color: var(--text-light); margin-top: 2px; }
.cat-master { margin-right: 4px; }
.adm-menu-item,
.adm-menu-item:link,
.adm-menu-item:visited {
    display: flex; justify-content: flex-start; align-items: center; gap: 6px;
    padding: 8px 8px; border-radius: 8px; color: var(--text); font-size: 13px;
    cursor: pointer; margin-bottom: 0; text-decoration: none; flex: 1; min-width: 0;
}
.adm-menu-item:hover { color: #d46b08; background: transparent; }
.adm-menu-item.active,
.adm-menu-item.active:hover,
.adm-menu-item.active:visited,
.adm-menu-item.active:link {
    background: transparent; color: var(--text); font-weight: 650;
}
.adm-menu-item .cnt { background: rgba(0,0,0,.08); border-radius: 10px; padding: 0 7px; font-size: 11px; margin-left: auto; }
.adm-menu-item.active .cnt { background: rgba(0,0,0,.08); }
.admin-menu-foot { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.admin-main { margin-bottom: 0; }
.admin-head { display: flex; align-items: center; margin-bottom: 16px; gap: 10px; }
.admin-head h3 { font-size: 16px; }
.admin-head .btn-primary { margin-left: auto; }
.adm-cat-tools .btn-primary { margin-left: 0; }
.param-bar { background: #f7f9fd; border-radius: 8px; padding: 12px 14px; margin-bottom: 14px; font-size: 13px; display: flex; align-items: center; gap: 8px; }
.param-bar input { width: 80px; height: 30px; }

/* 模态 */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,38,.45); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal { background: #fff; border-radius: 12px; width: 520px; max-width: 92vw; max-height: 88vh; display: flex; flex-direction: column; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-head { padding: 16px 20px; font-size: 16px; font-weight: 600; border-bottom: 1px solid var(--border); display: flex; align-items: center; }
.modal-close { margin-left: auto; cursor: pointer; color: var(--text-light); font-size: 22px; line-height: 1; }
.modal-body { padding: 20px; overflow-y: auto; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-field input[type=checkbox] { width: 18px; height: 18px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }
.form-field.span2 { grid-column: 1 / -1; }
.cap-list { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 8px 0 2px; }
.cap-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; border: 1px solid var(--border); border-radius: 8px; padding: 4px 8px; background: #fff; }
.cap-chk input { width: 14px; height: 14px; margin: 0; }
.cap-chk code { font-size: 11px; color: #94a3b8; }
.cap-ico { height: 16px; width: auto; max-width: 36px; object-fit: contain; display: block; }
.cap-picker { display: flex; flex-direction: column; gap: 8px; }
.cap-picked { display: flex; flex-direction: column; gap: 8px; }
.cap-empty { font-size: 13px; color: #94a3b8; padding: 8px 0; }
.cap-row {
    border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #f8fafc;
}
.cap-row-main { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cap-row-main .cap-name { flex: 1; min-width: 80px; font-size: 13px; font-weight: 600; }
.cap-qty-lab { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: #64748b; }
.cap-qty-lab .cap-qty { width: 72px; height: 32px; }
.cap-qty-lab .cap-res,
.cap-qty-lab .cap-fps { width: auto; min-width: 92px; height: 32px; }
.splice-config { display: flex; flex-direction: column; gap: 8px; }
.splice-quick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.splice-fixed-lab { font-size: 12px; font-weight: 600; color: #64748b; }
.cap-add-row { display: flex; gap: 8px; align-items: center; }
.cap-add-row select { flex: 1; min-width: 0; }
.cap-extra { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); }
.cap-extra > label { margin-bottom: 6px; }
.cap-extra-row { display: flex; align-items: center; gap: 8px; }
.cap-extra-row input { width: 120px; }
.splice-config { display: flex; flex-direction: column; gap: 8px; }
.form-field .splice-any-chk { display: inline-flex; align-self: flex-start; margin-bottom: 0; font-weight: 600; color: var(--text); }
.splice-any-row,
.master-link-field { display: flex; align-items: center; gap: 6px; }
.splice-any-hint { margin: 0; }
.splice-modes { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.splice-modes.is-disabled { opacity: 0.45; pointer-events: none; }
.splice-fixed-lab { font-size: 12px; font-weight: 600; color: #64748b; display: flex; align-items: center; gap: 4px; }
.splice-mode-row {
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
    border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; background: #f8fafc;
}
.splice-kind { width: 132px; }
.splice-xy { display: inline-flex; align-items: center; gap: 8px; }
.splice-xy[hidden] { display: none; }
.splice-xy input { width: 64px; height: 32px; }
.splice-xy-x { color: #94a3b8; font-weight: 600; }
.splice-mode-tip { flex: 1; min-width: 140px; font-size: 12px; }
.splice-quick { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.layers-field { display: flex; flex-direction: column; gap: 6px; }
.layers-row { display: flex; align-items: center; gap: 8px; }
.layers-row input { width: 160px; }
.img-field { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.img-field input[type=text] { flex: 1; min-width: 180px; }
.img-prev-wrap img { width: 64px; height: 44px; object-fit: contain; border: 1px solid var(--border); border-radius: 6px; background: #f7f9fd; }
.cell-img { width: 42px; height: 28px; object-fit: contain; border-radius: 4px; vertical-align: middle; background: #f7f9fd; }
.dev-img { width: 46px; height: 46px; border-radius: 8px; object-fit: contain; background: #f2f6fd; }

/* 区块卡片（走线等） */
.blk-card h4 { font-size: 15px; color: var(--primary); margin-bottom: 16px; display: flex; align-items: center; }
.blk-card h4 i { width: 22px; height: 22px; background: var(--primary); color: #fff; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center; font-style: normal; font-size: 13px; margin-right: 8px; }

/* 走线 */
.wiring-info { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; margin-bottom: 12px; }
.wi-item { flex: 1; min-width: 150px; display: flex; flex-direction: column; padding: 10px 14px; border-right: 1px solid var(--border); }
.wi-item:last-child { border-right: none; }
.wi-k { font-size: 12px; color: var(--text-light); }
.wi-v { font-size: 14px; color: var(--text); font-weight: 600; margin-top: 2px; word-break: break-word; }
.wi-v-block { font-weight: 500; font-size: 13px; line-height: 1.65; white-space: normal; }
.wiring-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.wiring-tip { font-size: 12px; color: var(--text-light); flex: 1; }
.wiring-wrap { overflow: auto; border: 1px solid var(--border); border-radius: 8px; background: #fbfcfe; padding: 8px; max-height: 600px; }
.wiring-view { display: flex; flex-direction: column; min-width: 0; }
.wiring-stage {
    position: relative;
    height: 520px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fbfcfe;
    cursor: grab;
    touch-action: none;
    user-select: none;
}
.wiring-stage.is-grabbing { cursor: grabbing; }
.wiring-stage-inner {
    position: absolute;
    left: 0; top: 0;
    transform-origin: 0 0;
    will-change: transform;
}
.wiring-stage-inner canvas { display: block; }
.wiring-zoombar {
    position: absolute;
    left: 12px; bottom: 12px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 6px 18px rgba(15, 23, 38, .12);
    overflow: hidden;
}
.wiring-zoombar button {
    width: 40px; height: 40px;
    border: none; background: #fff;
    color: #334155; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    padding: 0;
}
.wiring-zoombar button + button { border-top: 1px solid var(--border); }
.wiring-zoombar button:hover { background: #f7f9fd; color: var(--primary); }
.wiring-zoombar svg { width: 18px; height: 18px; display: block; }
.wiring-view:fullscreen,
.wiring-view:-webkit-full-screen,
.wiring-view.is-fs {
    background: #fff;
    padding: 16px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}
.wiring-view.is-fs {
    position: fixed; inset: 0; z-index: 240;
}
.wiring-view:fullscreen .wiring-stage,
.wiring-view:-webkit-full-screen .wiring-stage,
.wiring-view.is-fs .wiring-stage {
    flex: 1;
    height: auto;
    min-height: 0;
}
body.wiring-fs-lock { overflow: hidden; }
#wiringCanvas { display: block; }

/* 方案对比 */
.sol-params { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.sol-params label { font-size: 13px; color: var(--text-light); display: inline-flex; align-items: center; gap: 8px; }
.sol-adv-hint {
    font-size: 12px; color: var(--text-light); margin: 0 0 12px; line-height: 1.55;
    padding: 8px 12px; background: #f7f9fd; border-radius: 8px;
}
.solution-table-wrap { overflow-x: auto; margin-bottom: 14px; }
.sol-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sol-table th, .sol-table td { border: 1px solid var(--border); padding: 10px 12px; text-align: center; }
.sol-table th { background: #f2f6fd; font-weight: 600; white-space: nowrap; }
.sol-table tr:hover td { background: #fafcff; }
.sol-table tr.active td { background: rgba(43,108,255,.08); }
.sol-table .cost { font-weight: 700; color: var(--danger); }
.frag-tag { display: inline-block; padding: 1px 6px; border-radius: 4px; background: rgba(228,57,60,.1); color: var(--danger); font-size: 11px; margin-left: 4px; }
.solution-detail { background: #f7f9fd; border-radius: 8px; padding: 14px 16px; font-size: 13px; }
.sol-detail-head { margin-bottom: 10px; color: var(--text); }
.sol-meta { font-size: 12px; color: var(--text-light); margin-bottom: 8px; }
.sol-frag-warn { color: var(--danger); font-size: 12px; margin-bottom: 10px; }
.sol-grid-text { display: flex; flex-direction: column; gap: 8px; }
.sol-grid-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.sol-layer { width: 36px; font-size: 12px; color: var(--text-light); flex-shrink: 0; }
.sol-cell { display: inline-block; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 600; border: 1px solid var(--border); }
.sol-cell.main { background: rgba(43,108,255,.12); color: var(--primary); border-color: rgba(43,108,255,.3); }
.sol-cell.slave { background: rgba(0,168,112,.1); color: var(--accent); border-color: rgba(0,168,112,.3); }
#partitionCanvas { display: block; }

.chip-group { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 16px; border: 1px solid var(--border); border-radius: 20px; background: #fff; font-size: 13px; cursor: pointer; color: var(--text); }
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.chk { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }
.chk input { width: 16px; height: 16px; }

/* 翻页操作 */
.page-actions { display: flex; align-items: center; gap: 10px; margin: 8px 0 30px; }
.btn-primary.lg, .btn-ghost.lg { height: 44px; padding: 0 32px; font-size: 15px; border-radius: 10px; }
.page-actions .btn-primary.lg { margin-left: auto; }

/* 设备卡片 */
.device-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.dev-card { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.dev-icon { width: 46px; height: 46px; border-radius: 8px; background: rgba(43,108,255,.1); color: var(--primary); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.dev-body { flex: 1; }
.dev-model { font-weight: 600; font-size: 14px; }
.dev-name { font-size: 12px; color: var(--text-light); }
.dev-sub { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.dev-qty { font-size: 16px; font-weight: 700; color: var(--primary); }

/* 拓扑 */
.topo-wrap { overflow-x: auto; }
#topoView .wiring-stage { height: 420px; }
#topoCanvas { display: block; }
.topo-legend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-light); margin-bottom: 10px; }
.lg-line { display: inline-block; width: 22px; height: 3px; border-radius: 2px; }
.lg-line.video { background: #db2777; }
.lg-line.short { background: #2563eb; margin-left: 12px; }
.lg-line.feed { background: #94a3b8; margin-left: 12px; height: 2px; border-top: 1px dashed #94a3b8; background: transparent; }
.lg-line.cat6 { background: #0284c7; margin-left: 12px; }
.lg-line.wifi { background: transparent; margin-left: 12px; height: 2px; border-top: 2px dashed #16a34a; }
.plan-panel h2, .card h2 { font-size: 15px; font-weight: 600; margin-bottom: 14px; padding-left: 10px; border-left: 3px solid var(--primary); }

/* 响应式：平板 / 中屏 */
@media (max-width: 1080px) {
    .edit-body { grid-template-columns: 1fr; }
    .edit-preview { position: static; height: auto; min-height: 0; }
    .preview-wrap { min-height: 280px; flex: 1 1 auto; }
    .page { padding: 0 16px; }
}

.modal-body textarea { min-height: 80px; font-size: 13px; }
.topo-edit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.topo-edit-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px; }
.topo-edit-card h4 { margin-bottom: 10px; font-size: 14px; color: var(--primary); }
.topo-edit-card label { display: block; font-size: 12px; color: var(--text-light); margin: 8px 0 4px; }
.topo-edit-card input[type=text] { width: 100%; height: 34px; }
.topo-prev { margin-top: 10px; min-height: 80px; display: flex; align-items: center; justify-content: center; background: #f7f9fd; border-radius: 8px; padding: 8px; }
.topo-prev img { max-width: 100%; max-height: 120px; object-fit: contain; }

/* ===== 登录页（睿管家风格左右分栏） ===== */
body.login-body { overflow: auto; }
body.login-body .topbar { display: none !important; }
@media (min-width: 901px) {
    body.login-body { overflow: hidden; }
}

.login-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}
.login-shell--default-bg {
    background: linear-gradient(160deg, #f0f6ff 0%, #f8fbff 35%, #eef4fc 70%, #e8f0fa 100%);
}
.login-shell--custom-bg {
    background-color: #eef4fc;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
.login-shell--video-bg {
    background-image: none !important;
}
.login-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
.login-bg-waves {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}
.login-shell--default-bg .login-bg-waves {
    background:
        radial-gradient(ellipse 80% 50% at 10% 20%, rgba(43, 108, 255, 0.12) 0%, transparent 55%),
        radial-gradient(ellipse 60% 40% at 90% 80%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 320'%3E%3Cpath fill='%23dbeafe' fill-opacity='0.45' d='M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L0,320Z'/%3E%3C/svg%3E") bottom center / 100% auto no-repeat;
}

.login-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 48px 0;
}
.login-header-logo { height: 40px; max-width: 220px; object-fit: contain; display: block; }
.login-header-brand { font-size: 22px; font-weight: 800; color: var(--primary); letter-spacing: 1px; }
.login-header-divider { width: 1px; height: 22px; background: #cbd5e1; }
.login-header-sub { font-size: 15px; color: #64748b; font-weight: 600; }

.login-main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(24px, 6vw, 80px);
    padding: 24px 48px 16px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}
.login-hero {
    flex: 1;
    max-width: 520px;
    min-width: 0;
}
.login-hero-title {
    font-size: clamp(26px, 3.2vw, 38px);
    font-weight: 800;
    color: var(--primary);
    line-height: 1.25;
    margin: 0 0 12px;
    letter-spacing: 1px;
}
.login-hero-sub {
    font-size: 14px;
    color: #64748b;
    margin: 0 0 20px;
    line-height: 1.6;
}
.login-illus-wrap {
    margin-top: 8px;
    min-height: clamp(220px, 34vw, 380px);
}
.login-illus-svg { width: 100%; max-width: 480px; height: auto; display: block; }
.login-illus-img { width: 100%; max-width: 480px; height: auto; display: block; object-fit: contain; }

.login-panel { flex: 0 0 auto; width: min(400px, 92vw); }
.login-panel-card {
    background: #fff;
    border-radius: 12px;
    padding: 36px 32px 28px;
    box-shadow: 0 8px 32px rgba(43, 108, 255, 0.1), 0 2px 8px rgba(15, 23, 42, 0.06);
    border: 1px solid rgba(219, 234, 254, 0.8);
}
.login-panel-title {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--primary);
    margin: 0 0 28px;
}

.login-form-v2 .login-field {
    position: relative;
    margin-bottom: 18px;
}
.login-field-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    display: flex;
    pointer-events: none;
}
.login-form-v2 input {
    width: 100%;
    height: 46px;
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0 44px 0 42px;
    font-size: 14px;
    color: var(--text);
    background: #f3f5f9;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.login-form-v2 input:hover { background: #eef1f6; }
.login-form-v2 input:focus {
    outline: none;
    background: #fff;
    border-color: #93b4ff;
    box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.14);
}
.login-form-v2 input::placeholder { color: #94a3b8; }
.login-eye {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 4px;
    display: flex;
}
.login-eye:hover { color: var(--primary); }

.login-field-captcha input { padding-right: 110px; }
.captcha-badge {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    background: #eff6ff;
    border: 1px dashed #93c5fd;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.captcha-badge:hover { background: #dbeafe; }

.login-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
    color: #64748b;
}
.login-remember { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.login-remember input { width: auto; height: auto; margin: 0; }

.login-err { color: #e4393c; font-size: 13px; min-height: 20px; margin: 4px 0 8px; text-align: center; }
.login-submit {
    width: 100%;
    height: 46px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(90deg, #3b82f6, #2b6cff);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 4px;
    cursor: pointer;
    transition: opacity .15s, transform .1s;
}
.login-submit:hover { opacity: .92; }
.login-submit:active { transform: scale(.99); }
.login-submit:disabled { opacity: .6; cursor: not-allowed; }
.login-hint {
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    margin: 16px 0 0;
}

.login-footer {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 0 20px;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    padding: 16px 24px 24px;
    line-height: 1.5;
    white-space: nowrap;
    overflow-x: auto;
}

.login-footer-item {
    flex: 0 0 auto;
}

.login-footer-item + .login-footer-item::before {
    content: '|';
    margin-right: 20px;
    color: #cbd5e1;
}

@media (max-width: 900px) {
    .login-main { flex-direction: column; padding: 16px 20px; }
    .login-hero { text-align: center; max-width: 100%; }
    .login-illus-wrap { display: none; min-height: 0; }
    .login-header { padding: 20px 20px 0; }
    .login-panel { width: 100%; max-width: 400px; }
    .login-footer {
        flex-wrap: wrap;
        white-space: normal;
        gap: 8px 16px;
    }
    .login-footer-item + .login-footer-item::before {
        display: none;
    }
}

.logout-btn { margin-left: 10px; }
.site-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.site-form-grid .span2 { grid-column: span 2; }
.site-card {
    background: #fff; border: 1px solid var(--border); border-radius: 12px;
    padding: 20px 20px 18px; margin: 0 0 16px;
}
.site-card h4 { margin: 0 0 16px; font-size: 14px; font-weight: 700; color: var(--text); }

/* —— 系统管理左侧功能分类 —— */
.system-page .admin-layout { grid-template-columns: 240px 1fr; }
.system-page .sys-nav {
    padding: 12px; gap: 4px; min-height: 420px;
}
.sys-nav-head {
    font-size: 12px; font-weight: 650; color: #94a3b8;
    letter-spacing: .4px; padding: 4px 10px 10px;
}
.sys-nav-item,
.sys-nav-item:link,
.sys-nav-item:visited {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 11px 12px; border-radius: 10px;
    text-decoration: none; color: #334155;
    border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s;
}
.sys-nav-item:hover {
    background: #f8fafc; color: #0f172a; border-color: #e8eef5;
}
.sys-nav-item.active,
.sys-nav-item.active:hover,
.sys-nav-item.active:visited,
.sys-nav-item.active:link {
    background: #eff6ff; border-color: #bfdbfe; color: #1d4ed8;
}
.sys-nav-ico {
    width: 32px; height: 32px; border-radius: 8px; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 13px; font-weight: 700;
    background: #f1f5f9; color: #64748b;
}
.sys-nav-item.active .sys-nav-ico {
    background: #dbeafe; color: #2563eb;
}
.sys-nav-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding-top: 1px; }
.sys-nav-text b {
    font-size: 13px; font-weight: 650; line-height: 1.3;
}
.sys-nav-text em {
    font-style: normal; font-size: 11px; color: #94a3b8; line-height: 1.35;
    font-weight: 400;
}
.sys-nav-item.active .sys-nav-text em { color: #60a5fa; }

/* —— 进阶配置（内容区横排分类保持简洁） —— */
.adv-cfg-page { display: flex; flex-direction: column; gap: 14px; }
.adv-cfg-intro {
    margin: 0; padding: 12px 14px; border-radius: 10px;
    background: #f8fafc; border: 1px solid #e8eef5;
    font-size: 13px; color: #64748b; line-height: 1.55;
}
.adv-cfg-nav {
    display: flex; flex-wrap: wrap; gap: 8px; margin: 0;
}
.adv-cfg-tab {
    border: 1px solid #e2e8f0; background: #fff; color: #475569;
    border-radius: 8px; padding: 7px 12px; font-size: 13px; cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background .12s, border-color .12s, color .12s;
}
.adv-cfg-tab:hover { border-color: #cbd5e1; color: #0f172a; background: #f8fafc; }
.adv-cfg-tab.on {
    background: #eff6ff; border-color: #93c5fd; color: #1d4ed8; font-weight: 600;
}
.adv-cfg-tab .adv-cfg-tab-cnt {
    font-size: 11px; font-weight: 650; color: #94a3b8;
    background: #f1f5f9; border-radius: 999px; padding: 1px 7px;
    font-variant-numeric: tabular-nums;
}
.adv-cfg-tab.on .adv-cfg-tab-cnt { background: #dbeafe; color: #2563eb; }
.adv-cfg-panel {
    background: #fff; border: 1px solid #e8eef5; border-radius: 12px;
    overflow: hidden;
}
.adv-cfg-panel-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    padding: 14px 16px; background: #fafbfc; border-bottom: 1px solid #eef2f7;
}
.adv-cfg-panel-head h4 {
    margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--text);
}
.adv-cfg-panel-head p {
    margin: 0; font-size: 12px; color: #94a3b8; line-height: 1.45; max-width: 520px;
}
.adv-cfg-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.adv-cfg-table th {
    background: #f8fafc; color: #64748b; font-weight: 600; font-size: 12px;
    text-align: left; padding: 10px 14px; border-bottom: 1px solid #eef2f7;
    white-space: nowrap;
}
.adv-cfg-table td {
    padding: 12px 14px; border-bottom: 1px solid #f1f5f9;
    vertical-align: middle; color: var(--text);
}
.adv-cfg-table tr:last-child td { border-bottom: none; }
.adv-cfg-table tr:hover td { background: #fafcff; }
.adv-cfg-table td.center, .adv-cfg-table th.center { text-align: center; }
.adv-cfg-table td.ops { white-space: nowrap; text-align: right; }
.adv-cfg-id {
    display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px; font-weight: 600; letter-spacing: 0;
    color: #334155; background: #f1f5f9; border: 1px solid #e2e8f0;
    border-radius: 6px; padding: 3px 8px; line-height: 1.3;
    max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    vertical-align: middle;
}
.adv-cfg-name { font-weight: 650; color: #0f172a; }
.adv-cfg-note { color: #94a3b8; font-size: 12px; max-width: 220px; }
.adv-cfg-sort {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 28px; height: 24px; padding: 0 6px; border-radius: 6px;
    background: #f8fafc; color: #64748b; font-size: 12px; font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.adv-cfg-table .tag-ok, .adv-cfg-table .tag-bad {
    border-radius: 999px; padding: 3px 10px; font-size: 12px; font-weight: 600;
}
.adv-cfg-empty {
    text-align: center; color: #94a3b8; padding: 36px 16px !important; font-size: 13px;
}
@media (max-width: 900px) {
    .system-page .admin-layout { grid-template-columns: 1fr; }
    .adv-cfg-panel-head { flex-direction: column; }
}

.site-card .form-field label {
    display: block; font-size: 13px; color: #64748b; font-weight: 500; margin-bottom: 8px;
}
.site-media {
    display: flex; gap: 14px; align-items: center; margin-bottom: 16px;
    background: #f8fafc; border: 1px dashed #d8e0ea; border-radius: 10px; padding: 14px;
}
.site-media-prev {
    width: 132px; height: 72px; flex-shrink: 0; border-radius: 8px;
    background: #fff; border: 1px solid #e8eef5;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; color: #94a3b8; font-size: 12px;
}
.site-media-prev img { max-width: 100%; max-height: 64px; object-fit: contain; }
.site-media-prev video { max-width: 100%; max-height: 64px; object-fit: contain; background: #0f172a; }
.site-media-body { flex: 1; min-width: 0; }
.site-media-title { font-size: 13px; font-weight: 650; margin-bottom: 2px; }
.site-media-ops { display: flex; gap: 8px; margin-top: 10px; }
.site-section-title { margin: 8px 0 0; font-size: 14px; color: var(--text); font-weight: 700; }
.tag-ok { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #dcfce7; color: #166534; font-size: 12px; }
.tag-bad { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #fee2e2; color: #b91c1c; font-size: 12px; }
.tag-warn { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #fef3c7; color: #92400e; font-size: 12px; }
.ops-log-stack { margin: 6px 0 0; font-size: 11px; color: #64748b; white-space: pre-wrap; max-height: 120px; overflow: auto; background: #f8fafc; padding: 6px 8px; border-radius: 6px; }
.tag-warn { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #fef3c7; color: #92400e; font-size: 12px; }

/* 用户管理表单 */
.user-form-panel {
    background: #f8fafc;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 20px 22px 18px;
    margin-bottom: 20px;
}
.user-form-head { margin-bottom: 16px; }
.user-form-head h4 { margin: 0 0 4px; font-size: 15px; }
.user-form-head .muted { font-size: 12px; color: var(--text-light); }
.user-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 20px;
}
.user-form-grid .form-field input[type=text],
.user-form-grid .form-field input[type=password] {
    width: 100%;
}
.user-form-grid .form-field input:disabled { background: #eef2f7; color: #64748b; }
.user-form-grid .req { color: #e4393c; }
.role-options { display: flex; flex-direction: column; gap: 10px; margin-top: 4px; }
.role-opt {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    font-size: 14px;
}
.role-opt:has(input:checked) { border-color: var(--primary); background: #eff6ff; }
.role-opt input { margin-top: 3px; flex-shrink: 0; }
.role-desc { display: block; font-size: 12px; color: var(--text-light); margin-top: 2px; }
.user-form-err { color: #e4393c; font-size: 13px; min-height: 20px; margin: 8px 0 0; }
.user-form-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 14px; }
.tag-role-admin { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #dbeafe; color: #1d4ed8; font-size: 12px; }
.tag-role-user { display: inline-block; padding: 2px 8px; border-radius: 4px; background: #f1f5f9; color: #475569; font-size: 12px; }

.catalog-order-table .order-col { white-space: nowrap; width: 72px; }
.catalog-order-table .order-num { width: 36px; color: var(--text-light); font-size: 12px; }
.catalog-order-table .order-btn { min-width: 28px; padding: 0 6px; font-weight: 600; }
.catalog-order-table .order-btn:disabled { opacity: .35; cursor: not-allowed; }
.img-code-tag {
    display: inline-block; font-size: 11px; color: #64748b; background: #f1f5f9;
    padding: 2px 8px; border-radius: 4px; border: 1px dashed #cbd5e1;
}

/* ===== 布局编辑器 ===== */
.layout-page.full-page {
    max-width: none; padding: 0; margin: 0;
    display: flex; flex-direction: column;
    height: 100vh; box-sizing: border-box;
    overflow: hidden;
}
.layout-page.full-page .card {
    margin-bottom: 0;
}
.layout-topbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    padding: 10px 16px; background: #fff; border-bottom: 1px solid var(--border);
    position: sticky; top: 0; z-index: 20;
}
.layout-topbar .back { color: var(--primary); text-decoration: none; font-size: 14px; }
.layout-title { font-weight: 600; font-size: 15px; }
.layout-val-badge {
    font-size: 12px; padding: 2px 10px; border-radius: 999px; background: #f1f5f9; color: #64748b;
}
.layout-val-badge.ok { background: #dcfce7; color: #166534; }
.layout-val-badge.bad { background: #fee2e2; color: #b91c1c; }
.layout-top-ops { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.layout-body {
    display: grid; grid-template-columns: 252px 1fr 260px; grid-template-rows: minmax(0, 1fr); gap: 12px;
    padding: 12px; flex: 1; min-height: 0; box-sizing: border-box;
    overflow: hidden; align-items: stretch;
}
.layout-palette,
.layout-canvas-wrap,
.layout-props {
    min-height: 0; min-width: 0; height: 100%;
    overflow: hidden;
    display: flex; flex-direction: column;
    padding: 14px 16px;
}
.layout-side-head { flex-shrink: 0; }
.layout-side-scroll {
    flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto;
    margin-right: -4px; padding-right: 4px;
}
.layout-palette h3, .layout-props h3, .layout-props h4 { margin: 0 0 10px; font-size: 14px; }
.layout-palette .layout-side-head,
.layout-props > .layout-side-head { margin-bottom: 8px; }
.layout-sub { margin: 14px 0 8px; font-size: 13px; color: var(--text-light); }
.layout-palette .block { width: 100%; margin-bottom: 8px; }
.layout-card-list { display: flex; flex-direction: column; gap: 6px; }
.layout-card-item {
    display: flex; align-items: center; gap: 8px; padding: 8px 10px;
    border: 1px solid var(--border); border-radius: 6px; background: #fff; cursor: pointer; font-size: 13px; text-align: left;
}
.layout-card-item.active { border-color: var(--primary); background: #eff6ff; }
.layout-card-item .dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.layout-canvas-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; height: 100%; }
.layout-canvas-toolbar {
    display: flex; justify-content: space-between; align-items: center; gap: 8px;
    margin-bottom: 8px; font-size: 12px; color: var(--text-light); flex-wrap: wrap; flex-shrink: 0;
}
.layout-canvas-scroll {
    overflow: hidden; flex: 1; min-height: 0;
    background: #f8fafc; border-radius: 8px; padding: 8px; position: relative;
    display: flex; align-items: flex-start; justify-content: flex-start;
}
.layout-prop-panel {
    flex: 1; min-height: 0; overflow-x: hidden; overflow-y: auto;
    margin-right: -4px; padding-right: 4px;
}
.layout-props-foot {
    flex-shrink: 0; margin-top: 10px; padding-top: 10px;
    border-top: 1px solid var(--border);
}
.layout-props-foot h4 { margin: 0 0 8px; font-size: 13px; color: var(--text-light); }
.layout-props-foot h4:not(:first-child) { margin-top: 12px; }
.layout-issues-scroll {
    max-height: 140px; overflow-x: hidden; overflow-y: auto;
    margin-right: -4px; padding-right: 4px;
}
#layoutCanvas { display: block; margin: 0; cursor: default; flex-shrink: 0; }
.layout-drag-hint { margin: 0 0 8px; font-size: 12px; }
.layout-drag-grid {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 8px; margin-bottom: 12px;
}
.layout-drag-chip {
    cursor: grab; user-select: none; min-width: 0;
}
.layout-drag-chip.dragging { opacity: .55; cursor: grabbing; }
.layout-tile {
    display: flex; flex-direction: column; align-items: stretch; min-width: 0; gap: 5px;
}
.layout-tile-frame {
    width: 100%; aspect-ratio: 1 / 1; min-width: 0;
    border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
    background: #eef2f7; position: relative;
    transition: border-color .15s, box-shadow .15s;
}
.layout-drag-chip:hover .layout-tile-frame {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(43, 108, 255, .14);
}
.layout-tile-img {
    display: block; width: 100%; height: 100%;
    object-fit: cover; object-position: center; pointer-events: none;
}
.layout-tile-ph {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--primary); letter-spacing: 0.5px;
}
.layout-tile-name {
    font-size: 11px; line-height: 1.35; color: var(--text); text-align: center;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    padding: 0 1px;
}
.layout-hover-coord {
    font-size: 12px; font-weight: 600; color: var(--primary);
    padding: 2px 10px; background: #eff6ff; border-radius: 6px; margin-left: auto;
}
.layout-float-error {
    position: absolute; z-index: 30; pointer-events: none;
    background: #dc2626; color: #fff; font-size: 12px; font-weight: 600;
    padding: 6px 12px; border-radius: 6px; box-shadow: 0 4px 12px rgba(220,38,38,.35);
    white-space: nowrap; max-width: 320px;
}
.layout-family-badge {
    display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px;
    background: #eff6ff; color: #1d4ed8; margin-bottom: 8px;
}
.layout-prop-panel .load-mode-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.layout-prop-panel .load-mode-row label { display: flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.layout-prop-panel .manual-load-fields { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.layout-prop-panel .manual-load-fields input { width: 52px; height: 32px; padding: 0 8px; border-radius: 8px; }
.layout-canvas-toolbar .layout-sel-hint { color: #64748b; font-size: 11px; }
.layout-prop-panel select { width: 100%; height: 34px; padding: 0 10px; font-size: 13px; }
.layout-issues { font-size: 12px; }
.layout-issues .issue { padding: 6px 8px; border-radius: 6px; margin-bottom: 6px; }
.layout-issues .issue.err { background: #fee2e2; color: #991b1b; }
.layout-issues .issue.warn { background: #fef3c7; color: #92400e; }
.layout-issues .issue.ok { background: #dcfce7; color: #166534; }
.sol-foot-hint { margin: 10px 0 0; font-size: 12px; }
.manual-sol-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.manual-sol-head h5 { margin: 0; font-size: 14px; }
.quote-source-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; font-size: 13px; }
.quote-source-bar select { height: 32px; padding: 0 10px; }

/* 列表：桌面表格 / 手机卡片 */
.list-mobile { display: none; }
.sol-card-list { display: flex; flex-direction: column; gap: 10px; }
.sol-card {
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    background: #fff;
}
.sol-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sol-card-idx { font-size: 12px; color: var(--text-light); }
.sol-card-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    word-break: break-word;
}
.sol-card-meta { display: grid; gap: 6px; margin-bottom: 12px; }
.sol-card-meta .k {
    display: inline-block;
    min-width: 64px;
    color: var(--text-light);
    font-size: 12px;
}
.sol-card-meta .v { font-size: 13px; color: var(--text); word-break: break-word; }
.sol-card-ops { display: flex; flex-wrap: wrap; gap: 6px; }
.sol-card-ops .mini { margin: 0; }

@media (max-width: 960px) {
    .layout-body { grid-template-columns: 1fr; grid-template-rows: auto minmax(240px, 1fr) auto; }
    .layout-palette,
    .layout-props {
        height: auto;
        max-height: 40vh;
    }
    .layout-canvas-wrap { min-height: 240px; }
}

@media (max-width: 900px) {
    .login-main { flex-direction: column; padding: 16px 20px; }
    .login-hero { text-align: center; max-width: 100%; }
    .login-illus-wrap { display: none; min-height: 0; }
    .login-header { padding: 20px 20px 0; flex-wrap: wrap; }
    .login-panel { width: 100%; max-width: 400px; }
}

/* ===== 手机 / 窄屏 ===== */
@media (max-width: 720px) {
    .user-form-grid,
    .profile-form-grid,
    .site-form-grid,
    .grid3,
    .modal-body { grid-template-columns: 1fr; }
    .io-pair { grid-template-columns: 1fr; }
    .profile-form-grid .span2,
    .site-form-grid .span2 { grid-column: span 1; }
    .site-media { flex-direction: column; }
    .site-media-prev { width: 100%; min-height: 88px; }
    .admin-layout { grid-template-columns: 1fr; }

    /* 顶栏：只留 LOGO，导航完整可点 */
    .topbar {
        display: grid;
        grid-template-columns: auto 1fr auto;
        grid-template-areas:
            "brand nav user";
        height: auto;
        min-height: 48px;
        padding: 8px 10px;
        gap: 6px 8px;
        align-items: center;
    }
    .brand { grid-area: brand; min-width: 0; }
    .brand-name { display: none; }
    .brand-logo { font-size: 15px; letter-spacing: 0.5px; }
    .topnav {
        grid-area: nav;
        margin-left: 0;
        width: auto;
        min-width: 0;
        gap: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        justify-content: flex-start;
    }
    .topnav a {
        padding: 6px 10px;
        font-size: 13px;
        white-space: nowrap;
        flex-shrink: 0;
    }
    .topuser { grid-area: user; margin-left: 0; }
    .user-menu-name { display: none; }
    .user-menu-trigger { padding: 2px; }

    .page { margin: 10px auto; padding: 0 10px; width: 100%; box-sizing: border-box; }
    .card { padding: 12px; margin-bottom: 10px; }
    .crumb { margin-bottom: 8px; font-size: 12px; }

    .list-toolbar { flex-wrap: wrap; gap: 8px; }
    .list-toolbar .search { max-width: none; flex: 1 1 100%; width: 100%; }
    .list-toolbar .spacer { display: none; }
    .list-toolbar .btn-primary,
    .list-toolbar .btn-ghost { flex: 1 1 calc(50% - 4px); }

    /* 列表：手机用卡片，隐藏宽表 */
    .list-desktop { display: none !important; }
    .list-mobile { display: flex !important; }

    .table-wrap,
    .solution-table-wrap,
    .wiring-wrap,
    .topo-wrap {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        max-width: 100%;
    }
    .wiring-stage { height: 380px; overflow: hidden; }
    #topoView .wiring-stage { height: 340px; }
    table.grid { font-size: 12px; }
    table.grid th, table.grid td { padding: 8px; }
    .ops { white-space: normal; }
    .ops .mini { display: inline-block; margin: 2px; }

    .edit-head {
        display: grid;
        grid-template-columns: auto 1fr;
        grid-template-areas:
            "back title"
            "ops ops";
        gap: 8px 10px;
        padding: 12px;
        align-items: center;
    }
    .edit-head .back { grid-area: back; margin-right: 0; }
    .ehd-title { grid-area: title; font-size: 14px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
    .ehd-ops { grid-area: ops; margin-left: 0; width: 100%; display: flex; gap: 8px; }
    .ehd-ops .btn-primary,
    .ehd-ops .btn-ghost { flex: 1; min-width: 0; }

    .edit-form { padding: 12px; }
    .blk { margin-bottom: 16px; }
    .blk h4, .blk-card h4 { font-size: 14px; align-items: flex-start; }
    .hint-inline { display: block; margin: 4px 0 0 30px; }

    .eq-row {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        margin-top: 6px;
    }
    .eq-cell { width: 100%; }
    .eq-cell label {
        position: static;
        display: block;
        margin-bottom: 6px;
    }
    .eq-row .op { padding: 0; text-align: center; }

    .fld.inline { max-width: none; width: 100%; }
    .seg.seg-lg button { padding: 10px 6px; font-size: 13px; }
    .calc-summary { gap: 6px 12px; padding: 10px; font-size: 12px; }
    .preview-wrap { min-height: 220px; padding: 10px 10px 28px; }
    .preview-stage #previewCanvas { max-width: none; }

    .sol-table,
    .quote-table { font-size: 12px; }
    .sol-table th, .sol-table td,
    .quote-table th, .quote-table td { padding: 8px 6px; }
    .plan-toolbar label,
    .quote-source-bar label { width: 100%; display: block; }
    .plan-toolbar select,
    .plan-toolbar input[type=text],
    .quote-source-bar select { width: 100%; max-width: 100%; min-width: 0; }
    .card-summary { font-size: 12px; line-height: 1.7; word-break: break-word; }
    .quote-table input { width: 64px; height: 32px; font-size: 16px; }

    .info-grid { grid-template-columns: 1fr; }
    .info-item { border-right: none !important; }
    .info-item .k { width: 96px; flex-shrink: 0; font-size: 12px; padding: 8px; }
    .info-item .v { font-size: 13px; padding: 8px; word-break: break-word; }
    .view-head { flex-wrap: wrap; gap: 8px; }
    .view-head .head-ops { margin-left: 0; width: 100%; }
    .view-head .head-ops .btn-ghost { width: 100%; }

    .wiring-info { flex-direction: column; }
    .wi-item {
        min-width: 0; width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border);
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 8px;
    }
    .wi-item:last-child { border-bottom: none; }
    .wi-v { margin-top: 0; text-align: right; max-width: 65%; }
    .wiring-toolbar { flex-wrap: wrap; }
    .wiring-tip { flex: 1 1 100%; }

    .device-cards { grid-template-columns: 1fr; }
    .page-actions {
        flex-wrap: wrap;
        gap: 8px;
        margin: 8px 0 24px;
    }
    .page-actions .btn-primary.lg { margin-left: 0; width: 100%; }
    .page-actions .btn-ghost.lg { width: 100%; }

    .admin-menu {
        display: flex;
        flex-direction: column;
        min-height: 0;
        max-height: 52vh;
        padding: 8px;
    }
    .adm-tree { max-height: 28vh; }
    .cat-more { opacity: 1; }
    .admin-menu-foot {
        flex-direction: row;
        flex-wrap: wrap;
    }
    .admin-head { flex-wrap: wrap; gap: 8px; }
    .admin-head .btn-primary { margin-left: 0; width: 100%; }
    .param-bar { flex-wrap: wrap; }

    .modal {
        width: calc(100vw - 16px);
        max-width: calc(100vw - 16px);
        max-height: 90vh;
        border-radius: 12px;
        margin: 8px;
    }
    .modal-overlay { align-items: center; padding: 8px; }
    .img-field input[type=text] { min-width: 0; width: 100%; }

    .profile-head { flex-direction: column; align-items: flex-start; }
    .profile-actions .btn-primary { width: 100%; }

    .layout-page.full-page { height: 100dvh; height: 100vh; }
    .layout-topbar { padding: 8px 10px; }
    .layout-title { width: 100%; font-size: 13px; }
    .layout-top-ops { margin-left: 0; width: 100%; display: flex; flex-wrap: wrap; gap: 6px; }
    .layout-body { padding: 8px; gap: 8px; overflow: auto; }
    .layout-palette { max-height: 34vh; }
    .layout-props { max-height: 38vh; }
    .layout-float-error { max-width: calc(100vw - 24px); white-space: normal; }

    .chip { padding: 8px 14px; }

    input[type=text],
    input[type=number],
    input[type=password],
    select,
    textarea { font-size: 16px; }
}

@media (max-width: 480px) {
    .page { padding: 0 8px; }
    .login-panel-card { padding: 22px 16px 18px; }
    .login-header-divider { display: none; }
}

html { overflow-x: clip; }
body { overflow-x: clip; }
#app, .page, .card, .edit-form, .plan-panel, .edit-body, .blk-card { min-width: 0; max-width: 100%; }
img { max-width: 100%; height: auto; }


/* ===== 双体系方案对比 ===== */
.system-compare { margin-bottom: 14px; }
.sc-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.sc-tip { font-weight: 400; font-size: 12px; color: var(--muted, #8a94a6); }
.sc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 720px) { .sc-row { grid-template-columns: 1fr; } }
.sc-card { position: relative; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; background: #fff; }
.sc-card.sc-best { border-color: #16a34a; background: #f0fdf4; box-shadow: 0 0 0 1px #16a34a; }
.sc-badge { position: absolute; top: 8px; right: 8px; background: #16a34a; color: #fff; font-size: 11px; padding: 1px 8px; border-radius: 10px; }
.sc-head { font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.sc-body { font-size: 12px; color: var(--muted, #64748b); line-height: 1.7; }
.sc-cost { margin-top: 8px; font-size: 16px; font-weight: 700; color: #1d4ed8; }
.sc-diff { margin-top: 8px; font-size: 12px; color: #16a34a; }

/* ===== 进阶配置（选填） ===== */
.adv-blk { margin-top: 10px; }
.adv-card .adv-head h2 { border: none; padding: 0; margin: 0; font-size: 16px; }
.adv-opt { font-style: normal; font-weight: 500; color: var(--text-light); font-size: 13px; }
.adv-head { display: flex; align-items: center; justify-content: space-between; cursor: pointer; padding: 2px 0 8px; user-select: none; }
.adv-arrow { color: #8a94a6; font-size: 14px; transition: transform .15s; line-height: 1; }
.adv-card.collapsed #advPanel { display: none; }
.adv-card.collapsed > .adv-head .adv-arrow { transform: rotate(-90deg); }
.adv-sec {
    background: #f5f7fb; border-radius: 10px; margin-bottom: 10px; overflow: visible;
}
.adv-sec:last-child { margin-bottom: 0; }
.adv-sec-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; cursor: pointer; user-select: none;
    font-size: 14px; font-weight: 650; color: var(--text);
}
.adv-sec:not(.open) .adv-sec-body { display: none; }
.adv-sec:not(.open) .adv-sec-head .adv-arrow { transform: rotate(-90deg); }
.adv-sec-body { padding: 0 16px 16px; }
.adv-master-row { display: flex; align-items: center; gap: 12px; }
.adv-master-row label { font-size: 14px; white-space: nowrap; color: var(--text); }
.adv-master-row select { flex: 1; max-width: 480px; }
.adv-group { margin: 10px 0; }
.adv-label { display: block; font-size: 12px; color: var(--muted, #64748b); margin-bottom: 6px; }
.adv-checks, .adv-ifaces { display: flex; flex-wrap: wrap; gap: 8px 16px; }
.adv-chk { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; cursor: pointer; }
.adv-chk input { margin: 0; width: 16px; height: 16px; }
.adv-feat-params { margin-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.adv-param-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 10px; }
.adv-param-label { font-size: 13px; color: var(--muted, #64748b); min-width: 72px; }
.adv-param-num-wrap { display: inline-flex; align-items: center; gap: 4px; }
.adv-param-num { width: 52px; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 6px; font-size: 13px; text-align: center; }
.adv-param-unit { font-size: 13px; color: var(--muted, #64748b); }
.adv-param-select { min-width: 120px; height: 32px; border: 1px solid var(--border); border-radius: 8px; padding: 0 8px; font-size: 13px; background: #fff; }
.iface-toolbar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    margin-bottom: 12px; flex-wrap: wrap;
}
.iface-tip-wrap {
    position: relative; display: inline-flex; align-items: center; gap: 6px;
    color: var(--primary); font-size: 13px; cursor: default; white-space: nowrap;
}
.iface-tip-ico {
    width: 16px; height: 16px; border-radius: 50%; border: 1px solid currentColor;
    font-size: 11px; font-style: normal; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center; line-height: 1;
}
.iface-tip-pop {
    display: none; position: absolute; right: 0; bottom: calc(100% + 10px);
    min-width: 300px; max-width: 440px; background: #3a414b; color: #fff;
    border-radius: 8px; padding: 12px 14px; font-size: 12px; line-height: 1.75;
    z-index: 30; box-shadow: 0 8px 24px rgba(15,23,42,.22); text-align: left;
    white-space: normal;
}
.iface-tip-pop::after {
    content: ''; position: absolute; right: 16px; top: 100%;
    border: 7px solid transparent; border-top-color: #3a414b;
}
.iface-tip-wrap:hover .iface-tip-pop { display: block; }
.iface-tip-pop b { font-weight: 600; margin-right: 6px; color: #fff; }
.master-sel-lab { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; cursor: pointer; }
.master-sel-ck { width: 16px; height: 16px; vertical-align: middle; }

/* ===== LED工程文件库 ===== */
.page-files .file-lib-tabs { margin-bottom: 12px; }
.page-files .file-public-hint { margin: 0 0 12px; padding: 10px 12px; background: #f0f7ff; border-radius: 8px; color: #475569; }
.page-files .tab-count { font-size: 11px; opacity: 0.75; }
.tag-file { display: inline-block; padding: 1px 8px; font-size: 11px; color: #047857; background: #ecfdf5; border-radius: 8px; }
.file-upload { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }

/* ===== 左侧边栏 + 顶栏框架 ===== */
.shell { display: flex; min-height: 100vh; background: #f5f7fb; }
.sidebar { width: 224px; background: #fff; border-right: 1px solid var(--border); position: fixed; top: 0; left: 0; bottom: 0; z-index: 60; display: flex; flex-direction: column; transition: margin-left .2s ease; }
.side-brand { height: 56px; display: flex; align-items: center; justify-content: center; padding: 0 12px; border-bottom: 1px solid var(--border); min-width: 0; }
.side-brand-img { height: 36px; max-width: 180px; object-fit: contain; display: block; }
.side-logo { font-weight: 800; color: var(--primary); font-size: 16px; letter-spacing: .5px; white-space: nowrap; }
.side-name { font-size: 13px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.side-nav { flex: 1; padding: 8px 12px 20px; overflow-y: auto; }
.side-section { margin-bottom: 2px; }
.side-section-head {
    display: flex; align-items: center; gap: 8px; width: 100%;
    border: none; background: none; padding: 9px 10px; border-radius: 8px;
    color: #3a4657; font-size: 14px; font-weight: 600; cursor: pointer; text-align: left;
    transition: background .12s, color .12s;
}
.side-section-head:hover { background: #eef4ff; color: var(--primary); }
.side-section-title { flex: 1; min-width: 0; }
.side-chevron { font-size: 11px; color: #8a94a6; transition: transform .15s ease; }
.side-section.is-open .side-chevron { transform: rotate(180deg); }
.side-lock { font-size: 12px; opacity: .55; line-height: 1; }
.side-section-locked .side-lock { opacity: .85; }
.side-section-body { display: none; padding: 2px 0 6px 8px; }
.side-section.is-open .side-section-body { display: block; }
.side-section-body.side-section-locked { display: none !important; }
.side-section-body a {
    display: block; padding: 8px 10px 8px 28px; border-radius: 8px;
    color: #3a4657; font-size: 13px; margin-bottom: 2px; text-decoration: none;
    transition: background .12s, color .12s;
}
.side-section-body a:visited { color: #3a4657; }
.side-section-body a:hover { background: #eef4ff; color: var(--primary); }
.side-section-body a.active,
.side-section-body a.active:hover,
.side-section-body a.active:visited {
    background: var(--primary); color: #fff; font-weight: 600;
    box-shadow: 0 2px 6px rgba(43,108,255,.28);
}
.side-group { font-size: 11px; color: #8a94a6; padding: 16px 10px 6px; letter-spacing: 2px; }
.side-nav a { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 8px; color: #3a4657; font-size: 14px; margin-bottom: 2px; text-decoration: none; transition: background .12s, color .12s; }
.side-nav a:visited { color: #3a4657; }
.side-nav a:hover { background: #eef4ff; color: var(--primary); }
.side-nav a.active,
.side-nav a.active:hover,
.side-nav a.active:visited { background: var(--primary); color: #fff; font-weight: 600; box-shadow: 0 2px 6px rgba(43,108,255,.28); }
.side-ico { width: 20px; text-align: center; font-size: 15px; }
.side-user { padding: 12px 18px; border-top: 1px solid var(--border); }
.su-name { font-size: 13px; font-weight: 600; color: var(--text); }
.su-role { font-size: 11px; color: #8a94a6; }
.main-wrap { flex: 1; margin-left: 224px; min-width: 0; transition: margin-left .2s ease; }
body.side-collapsed .sidebar { margin-left: -224px; }
body.side-collapsed .main-wrap { margin-left: 0; }
.topbar2 { height: 56px; background: #fff; border-bottom: 1px solid var(--border); display: flex; align-items: center; padding: 0 20px; position: sticky; top: 0; z-index: 50; gap: 12px; }
.side-toggle { border: none; background: none; font-size: 19px; cursor: pointer; padding: 4px 8px; color: var(--text-light); border-radius: 6px; }
.side-toggle:hover { background: #f2f6fd; color: var(--primary); }
.side-close { display: none; }
.side-backdrop { display: none; }
.page-title { font-size: 16px; font-weight: 600; color: var(--text); }
.topuser { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.topuser-item { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text-light); font-size: 13px; }
.topuser-item:hover { color: var(--primary); }
.avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.logout-btn { font-size: 12px; }
.main-content { min-height: calc(100vh - 56px); }
.login-body .shell { display: flex !important; }
.login-body .sidebar,
.login-body .topbar2 { display: none !important; }
.login-body .main-wrap { margin-left: 0 !important; }
.login-body .main-content { min-height: 100vh; }

/* 分享只读页：隐藏侧栏与顶栏 */
body.public-view .sidebar,
body.public-view .topbar2 { display: none !important; }
body.public-view .main-wrap { margin-left: 0 !important; width: 100%; }
body.public-view .main-content { min-height: 100vh; padding-top: 16px; }

/* ===== 配单体验升级 ===== */
.list-head { margin-bottom: 12px; }
.list-tabs { display: flex; gap: 4px; }
.list-tab {
    height: 36px; padding: 0 16px; border: none; background: transparent;
    color: var(--text-light); font-size: 14px; cursor: default; border-bottom: 2px solid transparent;
}
.list-tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }
.char-count { text-align: right; font-size: 12px; color: var(--text-light); margin-top: 6px; }
.type-seg { display: flex; gap: 8px; }
.sol-name { font-weight: 600; }
.empty-cta p { margin-bottom: 12px; font-size: 14px; }
.ops { display: inline-flex; align-items: center; gap: 4px; }
.more-wrap { position: relative; display: inline-block; }
.more-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 4px);
    min-width: 124px; background: #fff; border: 1px solid var(--border);
    border-radius: 8px; box-shadow: 0 8px 24px rgba(15,23,42,.12); padding: 6px; z-index: 30;
}
.more-menu.open { display: block; }
.more-menu button {
    display: block; width: 100%; text-align: left; border: none; background: none;
    padding: 8px 10px; border-radius: 6px; font-size: 13px; cursor: pointer; color: var(--text);
}
.more-menu button:hover { background: #f2f6fd; color: var(--primary); }
.more-menu button.danger { color: var(--danger); }
.more-menu button.danger:hover { background: #fff5f5; color: var(--danger); }
.page-list .table-wrap { overflow: visible; }

.edit-head { flex-wrap: wrap; gap: 10px 16px; }
.wizard { display: flex; align-items: center; gap: 8px; margin-left: 8px; }
.wiz-step {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-light); white-space: nowrap;
}
.wiz-step i {
    width: 22px; height: 22px; border-radius: 50%; background: #e8edf5; color: #6b7686;
    display: inline-flex; align-items: center; justify-content: center;
    font-style: normal; font-size: 12px; font-weight: 600;
}
.wiz-step.active { color: var(--primary); font-weight: 600; }
.wiz-step.active i { background: var(--primary); color: #fff; }
.wiz-step.done { color: var(--accent); }
.wiz-step.done i { background: var(--accent); color: #fff; }
.wiz-line { width: 28px; height: 1px; background: var(--border); }

.calc-tabs {
    display: flex; background: #f3f6fb; border-radius: 10px; padding: 4px; gap: 4px; margin-bottom: 16px;
}
.calc-tab {
    flex: 1; height: 36px; border: none; background: transparent; border-radius: 8px;
    font-size: 13px; color: var(--text-light); cursor: pointer;
}
.calc-tab.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 4px rgba(15,23,42,.08); }
.calc-panel { margin-top: 4px; }
.ratio-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.spec-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.spec-pill {
    font-size: 12px; color: var(--text-light); background: #f3f6fb;
    border-radius: 999px; padding: 4px 10px;
}
.spec-pill b { color: var(--text); font-weight: 600; margin-left: 4px; }

.stepper {
    display: flex; align-items: center; width: 100%; height: 36px;
    border: 1px solid transparent; border-radius: 10px; background: #f3f5f9; overflow: hidden;
    transition: border-color .15s, box-shadow .15s, background .15s;
}
.stepper:hover { background: #eef1f6; }
.stepper:focus-within {
    background: #fff; border-color: #93b4ff;
    box-shadow: 0 0 0 3px rgba(43,108,255,.14);
}
.stepper input,
.stepper input:hover,
.stepper input:focus {
    flex: 1; min-width: 0; height: 34px; border: none !important; box-shadow: none !important;
    text-align: center; padding: 0 4px !important; border-radius: 0; background: transparent !important;
}
.stepper .sfx { position: static; right: auto; font-size: 11px; color: var(--text-light); padding-right: 4px; pointer-events: none; }
.step-btn {
    width: 32px; height: 34px; border: none; background: #f7f9fd; color: var(--text);
    font-size: 16px; cursor: pointer; flex-shrink: 0; line-height: 1;
}
.step-btn:hover { background: #eef3fb; color: var(--primary); }
.stepper.readonly { background: #f5f7fa; }
.stepper.readonly input { background: transparent; color: var(--text-light); }
.eq-cell { flex-direction: column; align-items: stretch; }
.eq-cell label { position: static; top: auto; margin-bottom: 6px; }
.eq-row { align-items: flex-end; }

.preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; flex-shrink: 0; }
.preview-head h4 { margin-bottom: 0; }
.preview-person {
    position: relative; display: flex; flex-direction: column; align-items: center;
    flex-shrink: 0; align-self: flex-end;
}
.preview-person-fig {
    display: block; object-fit: contain; object-position: bottom center;
    pointer-events: none; user-select: none; image-rendering: auto;
}
.preview-person-h {
    position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
    margin-top: 2px; color: #8a94a6; font-size: 11px; white-space: nowrap;
}
.preview-stats {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px;
    margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--border); flex-shrink: 0;
}
.preview-stats div { display: flex; flex-direction: column; gap: 2px; }
.preview-stats span { font-size: 12px; color: var(--text-light); }
.preview-stats b { font-size: 14px; color: var(--text); font-weight: 650; }
.sticky-actions {
    position: sticky; bottom: 0; z-index: 8;
    background: linear-gradient(transparent, #f5f7fb 28%);
    padding: 18px 0 8px; margin-top: 8px;
}
.leave-save-dialog { max-width: 420px; }
.leave-save-msg { margin: 0; line-height: 1.6; color: #475569; }
.leave-save-foot {
    display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap;
}
@media (max-width: 520px) {
    .leave-save-foot { flex-direction: column; }
    .leave-save-foot .btn-ghost,
    .leave-save-foot .btn-primary { width: 100%; }
}

.share-row { display: flex; gap: 8px; align-items: center; }
.share-row input { flex: 1; height: 36px; }
.dl-grid {
    display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 4px;
}
.dl-item {
    text-align: left; border: 1px solid #e2e8f0; border-radius: 12px;
    background: #fff; padding: 14px 14px 12px; cursor: pointer;
    color: inherit; font: inherit; appearance: none; -webkit-appearance: none;
    outline: none; box-shadow: none;
    transition: border-color .15s, box-shadow .15s, background .15s, opacity .15s;
}
.dl-item:hover { border-color: #7dd3c7; background: #f0fdfa; box-shadow: 0 2px 10px rgba(45,155,145,.08); }
.dl-item:focus, .dl-item:focus-visible, .dl-item:active {
    outline: none; border-color: #e2e8f0; background: #fff; box-shadow: none;
}
.dl-item:hover:focus, .dl-item:hover:focus-visible {
    border-color: #7dd3c7; background: #f0fdfa; box-shadow: 0 2px 10px rgba(45,155,145,.08);
}
.dl-item b { display: block; color: #0f172a; font-size: 14px; margin-bottom: 4px; font-weight: 700; }
.dl-item span { display: block; color: #94a3b8; font-size: 12px; line-height: 1.4; font-weight: 400; }
.dl-item:disabled, .dl-item.is-busy { opacity: .65; cursor: wait; }
@media (max-width: 640px) {
    .dl-grid { grid-template-columns: 1fr; }
}

.pkg-gallery {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 0 18px;
}
.pkg-strip {
    display: flex; gap: 16px; overflow-x: auto; padding: 8px 4px 20px;
    scroll-snap-type: x mandatory; scroll-behavior: smooth;
    scrollbar-width: none; -ms-overflow-style: none;
    flex: 1;
    min-width: 0;
}
.pkg-strip::-webkit-scrollbar { display: none; }
.pkg-nav {
    position: static;
    transform: none;
    flex: 0 0 32px;
    width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--border);
    background: #fff; color: #64748b; font-size: 20px; line-height: 1; cursor: pointer;
    box-shadow: 0 2px 8px rgba(15,23,42,.12); z-index: 2;
    display: flex; align-items: center; justify-content: center;
}
.pkg-nav:hover:not(:disabled) { color: var(--primary); border-color: var(--primary); }
.pkg-nav:disabled { opacity: .3; cursor: default; box-shadow: none; }

/* 推荐方案卡片 — 参考 Nova 配单风格 */
.pkg-card {
    position: relative;
    flex: 0 0 456px;
    width: 456px;
    scroll-snap-align: start;
    text-align: left;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    padding: 0;
    cursor: pointer;
    color: #64748b;
    transition: border-color .2s, box-shadow .2s, background .2s, transform .15s;
    overflow: visible;
    min-height: 200px;
    box-shadow: 0 2px 10px rgba(15, 35, 52, 0.04);
}
.pkg-card:hover:not(.active):not([aria-disabled="true"]) {
    border-color: #cbd5e1;
    box-shadow: 0 4px 16px rgba(15, 35, 52, 0.08);
}
.pkg-card.active {
    border: 2px solid #2d9b91;
    background: linear-gradient(165deg, #ecfdf9 0%, #dff5f3 48%, #e8f7f5 100%);
    color: #334155;
    box-shadow: 0 8px 28px rgba(45, 155, 145, 0.18);
    z-index: 1;
}
.pkg-card[aria-disabled="true"] { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* 左侧推荐/手工标识 */
.pkg-ribbon {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 3;
    display: flex;
    align-items: center;
    gap: 4px;
    background: linear-gradient(135deg, #fb923c 0%, #f97316 100%);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    padding: 8px 18px 8px 14px;
    border-radius: 12px 0 14px 0;
    letter-spacing: 1px;
    box-shadow: 2px 2px 10px rgba(249, 115, 22, 0.35);
    line-height: 1;
}
.pkg-ribbon-star {
    font-size: 13px;
    opacity: .95;
}

/* 右上角方案类型标题 */
.pkg-type-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.2;
    padding: 10px 18px;
    border-radius: 10px;
    letter-spacing: .6px;
    white-space: nowrap;
}
.pkg-card:not(.active) .pkg-type-badge {
    background: #f1f5f9;
    color: #64748b;
    border: 1px solid #e2e8f0;
}
.pkg-card.active .pkg-type-badge {
    background: linear-gradient(135deg, #2d9b91 0%, #14b8a6 55%, #38bdf8 100%);
    color: #fff;
    border: none;
    box-shadow: 0 4px 14px rgba(45, 155, 145, 0.35);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.pkg-body {
    position: relative;
    padding: 52px 16px 36px 16px;
    min-height: 168px;
}
.pkg-stack {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 20px;
    font-size: 12px;
    line-height: 1.4;
    padding-right: 88px;
}
.pkg-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
}
.pkg-row span {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 500;
}
.pkg-row b {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    word-break: break-word;
    line-height: 1.35;
}
.pkg-card.active .pkg-row span { color: #64748b; }
.pkg-card.active .pkg-row b { color: #0f172a; }
.pkg-row.pkg-empty { color: #cbd5e1; grid-column: 1 / -1; }

.pkg-rack-wrap {
    position: absolute;
    right: 8px;
    bottom: 12px;
    pointer-events: none;
}
.pkg-rack {
    width: 88px;
    height: 58px;
    display: block;
    opacity: .75;
}
.pkg-img {
    width: 88px;
    height: 58px;
    display: block;
    object-fit: contain;
    opacity: .85;
}
.pkg-ph {
    width: 88px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f1f5f9;
    color: #94a3b8;
    font-size: 12px;
    font-weight: 700;
}
.pkg-card:not(.active) .pkg-rack,
.pkg-card:not(.active) .pkg-img { opacity: .35; }
.pkg-card:not(.active) .pkg-ph { opacity: .55; }
.pkg-card.active .pkg-rack,
.pkg-card.active .pkg-img { opacity: .95; }
.pkg-card.active .pkg-ph { opacity: 1; }

/* 选中卡片底部指向详情区的三角 */
.pkg-caret {
    display: none;
    position: absolute;
    left: 50%;
    bottom: -11px;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 13px solid transparent;
    border-right: 13px solid transparent;
    border-top: 11px solid #2d9b91;
    filter: drop-shadow(0 2px 2px rgba(45, 155, 145, 0.15));
    z-index: 2;
}
.pkg-card.active .pkg-caret { display: block; }
.pkg-card.active .pkg-caret::after {
    content: '';
    position: absolute;
    left: -11px;
    top: -12px;
    border-left: 11px solid transparent;
    border-right: 11px solid transparent;
    border-top: 10px solid #e8f7f5;
}

.pkg-swap {
    position: absolute;
    left: 16px;
    bottom: 10px;
    font-size: 12px;
    font-weight: 700;
    color: #2d9b91;
    cursor: pointer;
    z-index: 3;
}
.pkg-swap:hover { text-decoration: underline; }

.pick-modal { width: 720px; max-width: 94vw; }
.pick-modal .modal-body.pick-grid,
.modal-body.pick-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
}
.pick-card {
    text-align: left;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    color: #334155;
}
.pick-card:hover { border-color: #7dd3c7; box-shadow: 0 4px 14px rgba(45,155,145,.12); }
.pick-card.active {
    border-color: #2d9b91;
    background: #f0fdfa;
    box-shadow: 0 0 0 2px rgba(45,155,145,.18);
}
.pick-thumb { height: 56px; display: flex; align-items: center; justify-content: center; }
.pick-thumb img, .pick-thumb .db-img, .pick-thumb .pkg-img { max-height: 52px; max-width: 100%; object-fit: contain; }
.pick-card b { font-size: 13px; color: #0f172a; }
.pick-card span { font-size: 12px; color: #64748b; line-height: 1.35; }
.pick-card.pick-card-center {
    text-align: center;
    align-items: center;
}
.pick-card.pick-card-center b,
.pick-card.pick-card-center span {
    display: block;
    width: 100%;
    text-align: center;
}
.pick-modal-sw .pick-card span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}
.pick-modal-sw .pick-thumb .db-ph {
    margin: 0 auto;
}

.sc-modal { width: 640px; max-width: 94vw; }
.sc-modal .modal-body {
    display: block;
    grid-template-columns: none;
}
.sc-sum {
    background: #eff8ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    padding: 12px 14px;
    font-size: 13px;
    color: #1e293b;
    line-height: 1.55;
    margin-bottom: 16px;
}
.sc-sum p { margin: 8px 0 0; color: #64748b; font-size: 12px; }
.sc-sec { margin-bottom: 18px; }
.sc-sec h4 {
    margin: 0 0 10px;
    font-size: 14px;
    color: #0f172a;
    padding-left: 8px;
    border-left: 3px solid #2d9b91;
}
.sc-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
}
.sc-img { width: 88px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.sc-img img, .sc-img .db-img { max-height: 40px; max-width: 88px; object-fit: contain; }
.sc-name { flex: 1; min-width: 0; font-size: 13px; font-weight: 650; color: #0f172a; }
.sc-name em { display: block; font-style: normal; font-size: 12px; color: #94a3b8; font-weight: 500; margin-top: 2px; }
.sc-step {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
}
.sc-minus, .sc-plus {
    width: 32px; height: 32px; border: none; background: #fff; cursor: pointer; font-size: 16px; color: #64748b;
}
.sc-plus { background: #2d9b91; color: #fff; }
.sc-n { min-width: 28px; text-align: center; font-weight: 700; font-size: 13px; }
.sc-ch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e2e8f0;
    background: #fff;
    border-radius: 10px;
    padding: 8px 10px;
    margin: 0 8px 8px 0;
    cursor: pointer;
    font-size: 12px;
}
.sc-ch.active { border-color: #2d9b91; background: #f0fdfa; }
.sc-ch.dim { opacity: 0.55; }

.detail-wrap h2, .acc-wrap h2 { margin-bottom: 10px; }
.detail-board {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 16px;
    overflow-x: auto;
    scrollbar-width: thin;
    background: linear-gradient(180deg, #dff5f3 0%, #e8f7f5 100%);
    border-radius: 12px;
    padding: 20px 16px 24px;
    margin-top: 10px;
    scroll-snap-type: x proximity;
}
.detail-board::-webkit-scrollbar { height: 6px; }
.detail-board::-webkit-scrollbar-thumb { background: rgba(45, 155, 145, 0.35); border-radius: 3px; }

.db-card {
    flex: 0 0 320px;
    width: 320px;
    box-sizing: border-box;
    background: linear-gradient(165deg, #f7fcfc 0%, #eef8f8 55%, #e9f6f5 100%);
    border: 1px solid #d5ebe8;
    border-radius: 14px;
    box-shadow: 0 4px 18px rgba(15, 35, 52, 0.06);
    padding: 18px 18px 14px;
    display: flex;
    flex-direction: column;
    min-height: 300px;
    scroll-snap-align: start;
}
.db-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    flex-shrink: 0;
}
.db-title {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.35;
    letter-spacing: .3px;
}
.db-opt {
    font-style: normal;
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
    margin-left: 4px;
}
.db-acts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    flex-shrink: 0;
    justify-content: flex-end;
}
.detail-board .db-link {
    border: none;
    background: none;
    color: #2d9b91;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    white-space: nowrap;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.db-act-ico { width: 14px; height: 14px; }
.detail-board .db-link.danger { color: #e11d48; }
.detail-board .db-link:hover { text-decoration: underline; }

.db-body { flex: 1 1 auto; min-height: 0; }
.db-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px 16px;
}
.db-cell span {
    display: block;
    font-size: 12px;
    color: #94a3b8;
    font-weight: 500;
    line-height: 1.3;
}
.db-cell b {
    display: block;
    margin-top: 5px;
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.35;
    word-break: break-word;
}
.db-sub {
    margin-top: 14px;
    padding-top: 10px;
    border-top: 1px dashed #cfe7e4;
}
.db-sub-lab {
    font-size: 12px;
    color: #64748b;
    font-weight: 600;
    margin-bottom: 4px;
}
.db-sub-val {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    color: #0f172a;
    font-weight: 600;
}
.db-expand {
    border: none;
    background: none;
    color: #2d9b91;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
}
.db-foot {
    flex-shrink: 0;
    margin-top: auto;
    padding-top: 14px;
    display: flex;
    justify-content: flex-start;
    align-items: flex-end;
    min-height: 88px;
}
.db-select {
    width: 100%;
    height: 32px;
    margin-bottom: 8px;
    font-size: 12px;
    padding: 0 10px;
}
.db-img {
    display: block;
    max-width: 168px;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
    background: transparent;
    padding: 0;
}
.db-ph {
    width: 72px;
    height: 52px;
    border-radius: 10px;
    background: #f1f5f9;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    letter-spacing: .3px;
}
.db-spec {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 13px;
    padding: 6px 0;
    color: #64748b;
    line-height: 1.45;
}
.db-spec span { flex-shrink: 0; }
.db-spec b {
    color: #1e293b;
    font-weight: 500;
    text-align: right;
    flex: 1;
    min-width: 0;
}
.db-spec-wrap {
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
}
.db-spec-wrap b {
    text-align: left;
    font-size: 12px;
    line-height: 1.5;
    color: #475569;
}
.db-empty {
    font-size: 13px;
    color: #94a3b8;
    padding: 16px 0;
    text-align: center;
}

.sw-list { display: flex; flex-direction: column; gap: 10px; }
.sw-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid #d9ece9;
    border-radius: 10px;
    padding: 12px 14px;
    position: relative;
}
.sw-item-scheme {
    background: #eef9f7;
    border-color: #cfe9e4;
}
.sw-ico {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    flex-shrink: 0;
    background: #fff;
    color: #2d9b91;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    box-shadow: 0 1px 4px rgba(45, 155, 145, 0.14);
    overflow: hidden;
}
.sw-ico img.sw-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}
.sw-body { flex: 1; min-width: 0; padding-right: 22px; }
.sw-name { font-size: 14px; font-weight: 700; color: #0f172a; line-height: 1.35; }
.sw-desc { font-size: 12px; color: #64748b; line-height: 1.45; margin-top: 4px; }
.sw-opt { font-style: normal; font-size: 12px; color: #94a3b8; font-weight: 500; }
.db-card[data-col="software"] .db-body { flex: 1; }
.db-card[data-col="software"] .sw-list { min-height: 120px; }
.sw-del {
    position: absolute;
    top: 8px;
    right: 8px;
    border: none;
    background: none;
    color: #94a3b8;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    padding: 0 2px;
}
.sw-del:hover { color: #e11d48; }

.acc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.acc-head h2 { margin-bottom: 0; font-size: 16px; }
.acc-head-hint { font-size: 12px; font-weight: 400; color: var(--text-light); }
.acc-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.acc-card {
    display: flex; align-items: center; gap: 12px; position: relative;
    flex: 1 1 220px; max-width: 280px; min-height: 80px;
    border: 1px solid #e8eef5; border-radius: 12px; padding: 12px 14px; background: #fff;
    box-shadow: 0 1px 4px rgba(15,23,42,.04);
}
.acc-ico {
    width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
    background: #eef3fb; color: var(--primary); font-weight: 700;
    display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.acc-ico.acc-cable-g { background: #dcfce7; color: #16a34a; }
.acc-ico.acc-cable-y { background: #fef9c3; color: #ca8a04; }
.acc-ico.acc-monitor { background: #e0f2fe; color: #0284c7; }
.acc-ico.acc-ribbon { background: #f1f5f9; color: #475569; }
.acc-ico.acc-magnet { background: #fee2e2; color: #dc2626; }
.acc-ico.acc-gpu { background: #e2e8f0; color: #334155; }
.acc-ico.acc-hdmi { background: #ede9fe; color: #7c3aed; }
.acc-img {
    width: 56px; height: 56px; object-fit: contain; flex-shrink: 0;
    border-radius: 8px; background: #fff;
}
.acc-meta { min-width: 0; flex: 1; }
.acc-name { font-size: 13px; font-weight: 600; color: var(--text); }
.acc-qty { font-size: 13px; color: var(--primary); font-weight: 700; margin-top: 2px; }
.acc-acts { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; }
.acc-act {
    border: none; background: none; color: #64748b; cursor: pointer;
    font-size: 12px; padding: 2px 0; line-height: 1.4; white-space: nowrap;
}
.acc-act:hover { color: var(--primary); }
.acc-act.del:hover { color: var(--danger); }
.acc-modal { width: 480px; }
.acc-modal .modal-body.acc-form {
    display: flex; flex-direction: column; gap: 14px; grid-template-columns: none;
}
.acc-req { color: var(--danger); }
.acc-img-ph {
    width: 72px; height: 72px; border: 1px dashed #cbd5e1; border-radius: 10px;
    background: #f8fafc; display: flex; align-items: center; justify-content: center;
    cursor: pointer;
}
.acc-img-ph:hover { border-color: var(--primary); background: #f5f8ff; }
.acc-img-edit { display: flex; align-items: center; gap: 8px; }
.acc-img-edit img {
    width: 56px; height: 56px; object-fit: contain; border-radius: 8px;
    border: 1px solid var(--border); background: #fff;
}
.acc-img-name { flex: 1; min-width: 0; font-size: 13px; color: #475569; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-img-ico {
    width: 28px; height: 28px; border: none; background: transparent;
    cursor: pointer; color: #64748b; font-size: 14px;
}
.acc-img-ico:hover { color: var(--primary); }
.acc-img-ico.del:hover { color: var(--danger); }
.acc-note-count { text-align: right; font-size: 12px; color: #94a3b8; margin-top: 4px; }

.spec-readonly {
    height: 36px; display: flex; align-items: center; padding: 0 10px;
    background: #f5f7fa; border: 1px solid var(--border); border-radius: 8px;
    color: var(--text); font-size: 13px;
}
.preview-legend { margin-top: 10px; font-size: 12px; color: var(--text-light); min-height: 18px; flex-shrink: 0; }
.leg-unfilled {
    display: inline-block; width: 12px; height: 12px; margin-right: 6px; vertical-align: -2px;
    background: repeating-linear-gradient(45deg, #cbd5e1, #cbd5e1 2px, #f1f5f9 2px, #f1f5f9 6px);
    border: 1px solid #94a3b8;
}
.iface-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px;
}
.iface-tile {
    border: 1px solid var(--border); border-radius: 10px; padding: 10px 8px 8px;
    text-align: center; background: #fff; cursor: pointer;
}
.iface-tile.on { border-color: var(--primary); background: #f5f8ff; }
.iface-badge {
    height: 36px; display: flex; align-items: center; justify-content: center;
    font-size: 11px; font-weight: 700; color: var(--primary); letter-spacing: .3px;
}
.iface-ico {
    height: 28px; width: auto; max-width: 86px; object-fit: contain; display: block;
    pointer-events: none;
}
.iface-name { font-size: 12px; color: var(--text); margin-bottom: 8px; word-break: break-all; line-height: 1.3; }
.iface-qty { display: flex; align-items: center; justify-content: center; gap: 6px; }
.iface-step {
    width: 22px; height: 22px; border: 1px solid var(--border); border-radius: 4px;
    background: #fff; cursor: pointer; font-size: 14px; line-height: 1;
}
.iface-step:hover { border-color: var(--primary); color: var(--primary); }
.iface-n { min-width: 16px; font-size: 13px; font-weight: 600; }

.av-icons { display: flex; flex-wrap: wrap; gap: 10px; margin: 10px 0 14px; }
.av-icon {
    width: 76px; border: 1px solid var(--border); border-radius: 10px; background: #fff;
    padding: 10px 6px 8px; cursor: pointer; color: var(--text);
}
.av-icon i {
    display: block; width: 36px; height: 36px; margin: 0 auto 6px; border-radius: 50%;
    background: #eef3fb; color: var(--primary); font-style: normal; font-weight: 700;
    line-height: 36px; font-size: 13px;
}
.av-icon span { display: block; font-size: 12px; }
.av-icon.on { border-color: var(--primary); background: #f5f8ff; }
.av-icon.on i { background: var(--primary); color: #fff; }
.av-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 10px; }
.av-table th, .av-table td { border: 1px solid var(--border); padding: 8px; text-align: center; }
.av-table th { background: #f7f9fd; }
.av-table input, .av-table select { height: 32px; }

@media (max-width: 1080px) {
    .wizard { margin-left: 0; width: 100%; order: 3; }
    .ehd-ops { margin-left: auto; }
    .preview-wrap { min-height: 280px; }
    .pkg-card { flex-basis: 440px; width: 440px; }
    .pkg-type-badge { font-size: 17px; padding: 8px 14px; }
    .iface-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
    .db-card { flex-basis: 300px; width: 300px; }
}
@media (max-width: 720px) {
    .db-card { flex-basis: min(300px, 82vw); width: min(300px, 82vw); }
    .detail-board { padding: 16px 12px 20px; gap: 12px; }
}
