: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-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; }

/* 页面通用 */
.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); }
.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; }
.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 { font-family: inherit; }
input[type=text], input[type=number], select { height: 36px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; color: var(--text); background: #fff; width: 100%; }
input:focus, select:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(43,108,255,.12); }
input[readonly], input:disabled { background: #f5f7fa; color: var(--text-light); }

/* 列表 */
.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; }
.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: start; }
.edit-form { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; }
.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 { position: sticky; top: 76px; }
.preview-card h4 { font-size: 14px; color: var(--primary); margin-bottom: 12px; }
.preview-wrap { background: #0e1726; border-radius: 8px; padding: 20px; display: flex; align-items: center; justify-content: center; min-height: 480px; }
#previewCanvas { max-width: 100%; height: auto; }

/* 报价区 */
.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-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: 200px 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; }
.adm-menu-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-radius: 8px; color: var(--text); font-size: 14px; cursor: pointer; margin-bottom: 2px; }
.adm-menu-item:hover { background: #f2f6fd; }
.adm-menu-item.active { background: var(--primary); color: #fff; }
.adm-menu-item .cnt { background: rgba(0,0,0,.08); border-radius: 10px; padding: 0 8px; font-size: 12px; }
.adm-menu-item.active .cnt { background: rgba(255,255,255,.25); }
.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; }
.admin-head h3 { font-size: 16px; }
.admin-head .btn-primary { margin-left: auto; }
.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 label { display: block; font-size: 13px; color: var(--text-light); margin-bottom: 6px; }
.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; }
.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; }
#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; }
.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; }

/* 功能需求 */
.func-row { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.func-label { font-size: 13px; color: var(--text-light); width: 70px; }
.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; }
#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: #ec4899; }
.lg-line.net { background: #2b6cff; margin-left: 12px; }
.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; }
    .preview-wrap { min-height: 420px; }
}
@media (max-width: 720px) {
    .admin-layout { grid-template-columns: 1fr; }
    .grid3 { grid-template-columns: 1fr; }
    .modal-body { grid-template-columns: 1fr; }
}

.modal-body textarea { width: 100%; min-height: 80px; padding: 8px; border: 1px solid var(--border); border-radius: 8px; font-family: inherit; 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: hidden; }
body.login-body .topbar { display: none !important; }

.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-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-shell--custom-bg .login-bg-waves {
    background: rgba(255, 255, 255, 0.72);
}

.login-header {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 48px 0;
}
.login-header-logo { height: 36px; object-fit: contain; }
.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; }
.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 #e2e8f0;
    border-radius: 8px;
    padding: 0 44px 0 42px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    box-sizing: border-box;
    transition: border-color .15s, box-shadow .15s;
}
.login-form-v2 input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(43, 108, 255, 0.12);
}
.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;
    text-align: center;
    font-size: 12px;
    color: #94a3b8;
    padding: 16px 24px 24px;
    line-height: 1.8;
}

@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; }
    .login-header { padding: 20px 20px 0; }
    .login-panel { width: 100%; max-width: 400px; }
}

.logout-btn { margin-left: 10px; }
.site-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; padding: 8px 0; }
.site-form-grid .span2 { grid-column: span 2; }
.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; }

/* 用户管理表单 */
.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%;
    height: 38px;
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0 12px;
    font-size: 14px;
    box-sizing: border-box;
}
.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; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; }
.layout-canvas-toolbar .layout-sel-hint { color: #64748b; font-size: 11px; }
.layout-prop-panel select { width: 100%; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
.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; border: 1px solid var(--border); border-radius: 6px; padding: 0 8px; }

@media (max-width: 960px) {
    .layout-body { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
    .user-form-grid { grid-template-columns: 1fr; }
    .profile-form-grid { grid-template-columns: 1fr; }
    .profile-form-grid .span2 { grid-column: span 1; }
}
