:root {
  --navy: #0e2438;
  --navy2: #16344f;
  --blue: #1f6fd0;
  --blue-soft: #eaf2fc;
  --accent: #e2833c;
  --green: #1f9254;
  --red: #c9382e;
  --amber: #b8770d;
  --bg: #f4f6f9;
  --card: #ffffff;
  --line: #e2e8f0;
  --text: #1c2b3a;
  --muted: #6b7c8f;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 38, 60, .06), 0 8px 24px rgba(16, 38, 60, .06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea {
  font-family: inherit; font-size: 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px;
  background: #fff; outline: none; transition: border-color .15s, box-shadow .15s; width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(31,111,208,.12); }
input[readonly] { background: #f7f9fb; color: var(--muted); }
label { font-size: 12.5px; color: var(--muted); display: block; margin-bottom: 5px; }

/* ---------- 登录 ---------- */
.login-wrap { display: flex; min-height: 100vh; }
.login-brand {
  flex: 1.15; background: linear-gradient(150deg, #0e2438 0%, #16344f 55%, #1b4a72 100%);
  color: #fff; padding: 56px 60px; display: flex; flex-direction: column; justify-content: space-between;
  position: relative; overflow: hidden;
}
.login-brand::after {
  content: ""; position: absolute; right: -160px; bottom: -160px; width: 520px; height: 520px;
  border-radius: 50%; background: radial-gradient(circle, rgba(226,131,60,.28), transparent 62%);
}
.login-brand .lg-top { display: flex; align-items: center; gap: 12px; font-size: 15px; letter-spacing: .5px; }
.logo-mark {
  width: 38px; height: 38px; border-radius: 9px; background: var(--accent);
  display: grid; place-items: center; font-weight: 700; font-size: 17px; color: #fff;
}
.login-brand h1 { font-size: 40px; line-height: 1.28; margin: 0 0 18px; font-weight: 600; letter-spacing: -.5px; }
.login-brand h1 em { font-style: normal; color: #f0a86a; }
.login-brand p.sub { color: #b8cade; font-size: 15px; max-width: 440px; margin: 0; }
.login-feats { display: flex; gap: 34px; margin-top: 34px; flex-wrap: wrap; }
.login-feats div b { display: block; font-size: 22px; font-weight: 600; color: #f0a86a; }
.login-feats div span { font-size: 12.5px; color: #9db2c8; }
.login-panel { flex: 1; display: grid; place-items: center; padding: 40px; background: #fff; }
.login-box { width: 100%; max-width: 340px; }
.login-box h2 { font-size: 23px; margin: 0 0 6px; font-weight: 600; }
.login-box .hint { color: var(--muted); font-size: 13px; margin: 0 0 26px; }
.login-box .field { margin-bottom: 16px; }
.login-box button {
  width: 100%; border: 0; border-radius: 8px; padding: 11px; font-size: 15px; font-weight: 500;
  background: var(--navy); color: #fff; margin-top: 6px; transition: background .15s;
}
.login-box button:hover { background: var(--navy2); }
.login-box button:disabled { opacity: .6; cursor: default; }
.err { color: var(--red); font-size: 13px; min-height: 20px; margin-top: 10px; }
/* 密码框 + 显隐按钮 */
.pwd-wrap { position: relative; }
.pwd-wrap input { padding-right: 62px; }
.login-box .pwd-eye,
.chpwd-box .pwd-eye,
.pwd-eye {
  position: absolute !important; right: 6px; top: 50%; transform: translateY(-50%);
  width: auto !important; margin-top: 0 !important;
  border: 0; background: transparent; color: var(--muted); font-size: 12.5px;
  cursor: pointer; padding: 4px 6px; border-radius: 5px; line-height: 1.4;
}
.login-box .pwd-eye:hover,
.pwd-eye:hover { color: var(--blue); background: var(--bg); }

/* ---------- 强制改密页 ---------- */
.chpwd-wrap { min-height: 100vh; display: grid; place-items: center; padding: 32px 16px; background: var(--bg); }
.chpwd-card {
  width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line);
  border-radius: 12px; padding: 30px 30px 22px; box-shadow: 0 8px 28px rgba(16,42,67,.08);
}
.chpwd-card h2 { font-size: 19px; margin: 12px 0 14px; font-weight: 600; }
.alert {
  border-radius: 8px; padding: 11px 13px; font-size: 12.5px; line-height: 1.65; margin-bottom: 18px;
}
.alert.warn { background: #fff7e8; border: 1px solid #f3ddb0; color: #7a5218; }
.chpwd-card .field { margin-bottom: 14px; }
.chpwd-card label { margin-bottom: 6px; }
.chpwd-card button[type=submit] {
  width: 100%; border: 0; border-radius: 8px; padding: 11px; font-size: 15px; font-weight: 500;
  background: var(--navy); color: #fff; margin-top: 4px; transition: background .15s;
}
.chpwd-card button[type=submit]:hover { background: var(--navy2); }
.chpwd-card button[type=submit]:disabled { opacity: .6; cursor: default; }
.meter { height: 5px; border-radius: 3px; background: #e8edf3; margin-top: 8px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: #dfe6ee; transition: width .18s, background .18s; }
.meter-txt { font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.rules { list-style: none; padding: 0; margin: 4px 0 16px; font-size: 11.5px; color: var(--muted); }
.rules li { padding-left: 18px; position: relative; line-height: 1.9; }
.rules li::before { content: "•"; position: absolute; left: 6px; }
.rules li.ok { color: #2ea86a; }
.rules li.ok::before { content: "✓"; }
.rules li.no { color: var(--red); }
.chpwd-foot {
  display: flex; justify-content: space-between; align-items: center; margin-top: 14px;
  border-top: 1px dashed var(--line); padding-top: 12px; font-size: 12px; color: var(--muted);
}
.chpwd-foot a { color: var(--blue); text-decoration: none; }

/* ---------- 应用骨架 ---------- */
.shell { display: grid; grid-template-columns: 224px 1fr; min-height: 100vh; }
.side { background: var(--navy); color: #cfe0f0; padding: 18px 14px; display: flex; flex-direction: column; }
.side .brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; color: #fff; }
.side .brand b { font-size: 15px; font-weight: 600; letter-spacing: .3px; }
.side .brand span { display: block; font-size: 11px; color: #8ba8c4; font-weight: 400; }
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  display: flex; align-items: center; gap: 9px; background: none; border: 0; color: #cfe0f0;
  padding: 9px 11px; border-radius: 7px; font-size: 13.5px; text-align: left; width: 100%;
}
.nav button:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav button.on { background: rgba(255,255,255,.13); color: #fff; font-weight: 500; }
.nav .ico { width: 16px; text-align: center; opacity: .85; }
.nav .badge { margin-left: auto; background: var(--accent); color: #fff; font-size: 11px; border-radius: 20px; padding: 0 7px; }
.side .foot { margin-top: auto; padding: 14px 8px 4px; border-top: 1px solid rgba(255,255,255,.1); font-size: 12px; }
.side .foot .who { color: #fff; font-size: 13px; }
.side .foot .role { color: #8ba8c4; }
.side .foot button { background: none; border: 1px solid rgba(255,255,255,.2); color: #cfe0f0; border-radius: 6px; padding: 4px 10px; font-size: 12px; margin-top: 10px; }
.side .foot .foot-btns { display: flex; gap: 8px; }
.side .foot button:hover { background: rgba(255,255,255,.1); }

/* ---------- 两侧面板收起 / 展开 ---------- */
.side .brand { position: relative; }
.side-hide {
  margin-left: auto; width: 24px; height: 24px; flex: 0 0 24px; padding: 0; line-height: 1;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.18);
  color: #cfe0f0; border-radius: 6px; font-size: 13px;
}
.side-hide:hover { background: rgba(255,255,255,.14); color: #fff; }
.side-show {
  display: none; position: fixed; left: 12px; top: 14px; z-index: 45;
  width: 34px; height: 34px; padding: 0; font-size: 15px; line-height: 1;
  background: #fff; color: var(--navy); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: var(--shadow);
}
.side-show:hover { border-color: var(--blue); color: var(--blue); }
body.side-hidden .shell { grid-template-columns: 1fr; }
body.side-hidden .side { display: none; }
body.side-hidden .side-show { display: block; }

.editor { position: relative; }
.editor.aside-hidden { grid-template-columns: 1fr; }
.editor.aside-hidden .aside { display: none; }
.sum-hide { flex: 0 0 auto; }
.sum-card .hd .tip { margin-left: auto; }
.card .hd .sum-hide { padding: 2px 9px; font-size: 12px; border-radius: 6px; }
.aside-toggle {
  display: none; position: fixed; right: 18px; bottom: 24px; z-index: 45;
  padding: 6px 12px; font-size: 12.5px; background: #fff; color: var(--navy);
  border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow);
}
.aside-toggle:hover { border-color: var(--blue); color: var(--blue); }
.editor.aside-hidden .aside-toggle { display: block; }
/* 内部控价为内部数据：任何打印 / 导出场景都不输出（打印稿本身由独立模板生成，此处是浏览器直接打印页面时的兜底） */
@media print { .ic-total, .ic-note { display: none !important; } }
@media print { .side-hide, .side-show, .aside-toggle, .sum-hide { display: none !important; } }

.main { padding: 22px 26px 40px; min-width: 0; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 20px; font-weight: 600; }
.page-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }

.btn { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 15px; font-size: 13.5px; color: var(--text); }
.btn:hover { border-color: #c5d2e0; background: #fafcfe; }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy2); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.ghost { background: transparent; }
.btn.sm { padding: 5px 11px; font-size: 12.5px; border-radius: 7px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.card .hd { padding: 14px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card .hd h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.card .hd .tip { font-size: 12px; color: var(--muted); font-weight: 400; }
.card .bd { padding: 18px; }

/* ---------- 报价列表 ---------- */
.toolbar { display: flex; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.toolbar input { max-width: 280px; }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13.5px; }
table.list th { font-size: 12px; color: var(--muted); font-weight: 500; background: #fbfcfd; white-space: nowrap; }
table.list tbody tr:hover { background: #f9fbfd; cursor: pointer; }
table.list td.num, table.list th.num { text-align: right; font-variant-numeric: tabular-nums; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }

.pill { display: inline-block; font-size: 12px; padding: 2px 9px; border-radius: 20px; line-height: 1.7; white-space: nowrap; }
.pill.draft { background: #eef1f5; color: #5b6b7c; }
.pill.pending { background: #fdf1dc; color: var(--amber); }
.pill.approved { background: #e6f4ec; color: var(--green); }
.pill.rejected { background: #fbe9e7; color: var(--red); }
.pill.void { background: #eceff3; color: #8b98a6; }
/* 归档三态：与单据状态（draft/pending/…）是平行维度，配色刻意错开避免混淆 */
.pill.arch-none { background: #eef1f5; color: #5b6b7c; }
.pill.arch-req { background: #e8f1fb; color: var(--navy); }
.pill.arch-done { background: #eceef2; color: #3c4a5a; font-weight: 600; }
.empty { padding: 56px 20px; text-align: center; color: var(--muted); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }

/* ---------- 编辑器 ---------- */
.editor { display: grid; grid-template-columns: 1fr 316px; gap: 18px; align-items: start; }
.editor-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.grid3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 13px; }

/* 第 1 步「客户与项目」：统一标签行高、控件间距与对齐（标签一律单行，说明文字移到控件下方） */
.cust-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 16px; align-items: start; }
.cust-grid .field { min-width: 0; }
.cust-grid .field > label {
  display: block; margin: 0 0 6px; height: 18px; line-height: 18px;
  font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.req { color: var(--red); }
@media (max-width: 1200px) { .cust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.cust-note { font-size: 11.5px; color: var(--muted); line-height: 1.6; margin-top: 6px; }
/* 卡片标题右侧的「历史客户」快速选择：不占表单格子，避免和字段混排 */
.hd-pick { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.hd-pick label { margin: 0; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.hd-pick select { width: auto; min-width: 150px; padding: 5px 9px; font-size: 13px; }
/* 图纸上传：按钮 + 说明 + 文件芯片列表 */
.up-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.up-zone .btn { flex: none; }

/* 图纸附件：已上传文件芯片（文件名 + 大小 + 移除） */
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; max-width: 100%;
  margin: 0 8px 8px 0; padding: 5px 6px 5px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: #fbfcfe; font-size: 12.5px;
}
.file-chip .nm { max-width: 320px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-chip .sz { color: var(--muted); font-variant-numeric: tabular-nums; }
.file-chip .st { font-size: 11.5px; padding: 1px 7px; border-radius: 20px; border: 1px solid var(--line); color: var(--muted); }
.file-chip .st.up { color: var(--blue); border-color: rgba(31,111,208,.4); background: #f2f7fd; }
.file-chip .st.ok { color: #1a7f4b; border-color: rgba(26,127,75,.35); background: #f2faf5; }
.file-chip .st.err { color: var(--red); border-color: rgba(200,50,50,.35); background: #fdf3f3; }
.file-chip.bad { border-color: rgba(200,50,50,.45); background: #fdf6f6; }
.file-chip button.re { font-size: 12px; }
.file-chip button {
  width: 20px; height: 20px; line-height: 1; padding: 0; flex: none;
  border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--muted); font-size: 14px;
}
.file-chip button:hover { border-color: var(--red); color: var(--red); }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; }
.span2 { grid-column: span 2; }

.host-pick { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.host-card { border: 1px solid var(--line); border-radius: 9px; padding: 12px 14px; background: #fbfcfe; }
.host-card .code { font-weight: 600; font-size: 14px; letter-spacing: .3px; }
.host-card .specs { display: flex; gap: 16px; margin-top: 6px; color: var(--muted); font-size: 12px; flex-wrap: wrap; }
.host-card .price { margin-top: 8px; font-size: 13px; }
.host-card .price b { font-size: 16px; color: var(--navy); }

/* 主机选型表（多台不同型号） */
.host-tbl { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.host-tbl th { background: #fbfcfd; white-space: nowrap; }
.host-tbl td { vertical-align: middle; }
.host-tbl tbody tr:hover { background: #fbfcfe; }
.host-tbl select { width: 100%; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.host-tbl input { border: 1px solid var(--line); border-radius: 6px; }
.host-tbl tfoot td { border-bottom: 0; background: #fbfcfd; }

/* 远程 Smart Panel 有 / 没有 */
.sp-box { margin-top: 12px; border: 1px dashed var(--line); border-radius: 8px; padding: 8px 12px; background: #fbfcfd; }
.sp-t { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.sp-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sp-row .seg button { padding: 5px 15px; font-size: 12.5px; }
.sp-hint { font-size: 12.5px; color: var(--muted); }

.indoor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 10px; }
.indoor-cell { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.indoor-cell .code { font-size: 12.5px; font-weight: 500; flex: 1; }
.indoor-cell .price { font-size: 11.5px; color: var(--muted); }
.indoor-cell input { width: 52px; padding: 4px 6px; text-align: center; font-size: 13px; }
.indoor-cell.has { border-color: #bcd7f5; background: var(--blue-soft); }

/* 配置表拖动排序 */
.drag-handle { cursor: grab; text-align: center; color: #b6c2d1; font-size: 13px; letter-spacing: -1px; user-select: none; }
.drag-handle:active { cursor: grabbing; }
tr.dragging { opacity: .4; }
tr.drop-over td { border-top: 2px solid var(--blue); }

/* 分水器按楼层配置（紧凑：每层一行） */
.mf-box { margin-top: 10px; border: 1px dashed var(--line); border-radius: 8px; padding: 7px 12px; background: #fbfcfd; }
.mf-t { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.mf-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 3px 0; border-top: 1px dashed #e6ecf3; }
.mf-row:first-of-type { border-top: 0; }
.mf-f { font-size: 13px; min-width: 28px; }
.mf-hint { font-size: 12px; color: var(--muted); }
.mf-row select { width: auto; min-width: 118px; max-width: 170px; padding: 3px 6px; font-size: 12.5px; height: 26px; }
.mf-add, .mf-x { border: 1px solid var(--line); background: #fff; border-radius: 6px; font-size: 12px; padding: 2px 8px; color: var(--muted); white-space: nowrap; }
.mf-add:hover { border-color: var(--blue); color: var(--blue); }
.mf-x { color: var(--red); padding: 2px 6px; }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg button { border: 0; background: #fff; padding: 7px 14px; font-size: 13px; color: var(--muted); }
.seg button.on { background: var(--navy); color: #fff; }

/* 内部控价·房屋类型参数卡：紧凑排版（小输入框、密排行距） */
.ic-card { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-top: 8px; }
.ic-card input { padding: 4px 8px; font-size: 12.5px; border-radius: 6px; }
.ic-card .seg { border-radius: 6px; }
.ic-card .seg button { padding: 4px 10px; font-size: 12px; }
.ic-card .ic-f { display: flex; flex-direction: column; gap: 2px; font-size: 11px; color: var(--muted); min-width: 0; }
.ic-card .ic-note { font-size: 11px; color: var(--muted); align-self: end; padding-bottom: 4px; line-height: 1.5; }

.detail-group { border-top: 1px solid var(--line); }
/* 窄窗口保护：明细表保住最小宽度，宁可横向滚动也不把输入框挤到裁字（打印稿用 .it.detail，不受影响） */
@media screen {
  #detail .detail-group { overflow-x: auto; }
  #detail table.detail { min-width: 980px; }
}
.detail-group:first-child { border-top: 0; }
.detail-group .gh { display: flex; align-items: center; gap: 10px; padding: 10px 18px; background: #fbfcfd; cursor: pointer; user-select: none; }
.detail-group .gh .idx { font-size: 12px; color: var(--muted); width: 18px; }
.detail-group .gh b { font-size: 13.5px; font-weight: 600; }
.detail-group .gh .sum { margin-left: auto; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13.5px; }
.detail-group .gh .chev { color: var(--muted); font-size: 11px; transition: transform .15s; }
.detail-group.collapsed .gh .chev { transform: rotate(-90deg); }
.detail-group.collapsed .gb { display: none; }
table.detail { width: 100%; border-collapse: collapse; table-layout: fixed; }
table.detail th, table.detail td { padding: 7px 10px; font-size: 12.8px; border-bottom: 1px solid #f0f3f7; }
table.detail th { color: var(--muted); font-weight: 500; font-size: 11.5px; background: #fdfdfe; text-align: left; position: relative; user-select: none; }
/* 数值列（单价 / 数量 / 总价）与文字列统一居中，和打印 / 导出 PDF 保持一致 */
table.detail td.num, table.detail th.num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
/* 列宽拖拽手柄：拖动后写入 localStorage，打印 / 导出 PDF 沿用 */
table.detail th .cr { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; }
table.detail th .cr:hover { background: rgba(24, 93, 166, .16); }
table.detail th:last-child .cr { display: none; }
body.col-resizing { cursor: col-resize; }
table.detail td.qty input { width: 62px; padding: 3px 6px; font-size: 12.5px; text-align: center; }
/* 价格档：明细行内的品牌 / 规格型号下拉与可改单价 */
table.detail select.sku-sel { width: 100%; max-width: 100%; padding: 3px 5px; font-size: 12.5px;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text); }
table.detail select.sku-sel:disabled { color: var(--muted); background: #f7f9fb; cursor: default; }
table.detail input.sku-price { width: 100%; min-width: 0; max-width: 100%; padding: 3px 4px; font-size: 12.5px; text-align: right;
  border: 1px solid var(--line); border-radius: 6px; background: #fff; font-variant-numeric: tabular-nums; }
/* 表格里的数字输入框：隐藏原生步进按钮（占右侧约 15px，会把右对齐的数字裁掉），仍可用方向键微调 */
table.detail input[type="number"]::-webkit-outer-spin-button,
table.detail input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
table.detail input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
/* 全站统一：数字输入框一律隐藏步进按钮（明细表 / 房间配置 / 后台报价数据页等），避免窄列裁字 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
table.detail input.sku-price.manual { border-color: var(--amber); background: #fffaf0; }
table.detail tr.manual td { background: #fffdf6; }
table.detail tr.warnrow td { background: #fff8ec; }
#designBox .detail td, #designBox .detail th { padding: 4px 6px; }
#designBox select { padding: 3px 5px; font-size: 12.5px; height: 28px; }
#designBox input { padding: 3px 5px; font-size: 12.5px; height: 28px; }
table.detail .tag { font-size: 10.5px; color: var(--muted); border: 1px solid var(--line); border-radius: 3px; padding: 0 4px; margin-left: 5px; }
table.detail input[data-note] { width: 100%; padding: 2px 5px; font-size: 12.5px; border: 1px solid transparent; border-radius: 5px; background: transparent; }
table.detail input[data-note]::placeholder { color: #c3cad4; }
table.detail input[data-note]:hover { border-color: #e6eaf0; }
table.detail input[data-note]:focus { border-color: var(--line); background: #fff; outline: none; }

/* ---------- 汇总侧栏 ---------- */
.aside { position: sticky; top: 22px; display: flex; flex-direction: column; gap: 14px; }
.sum-card .bd { padding: 16px 18px; }
.sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13.5px; }
.sum-row span:last-child { font-variant-numeric: tabular-nums; }
.sum-row.muted { color: var(--muted); font-size: 12.5px; }
.sum-total { border-top: 1px solid var(--line); margin-top: 10px; padding-top: 12px; display: flex; justify-content: space-between; align-items: baseline; }
.sum-total .k { font-size: 13px; color: var(--muted); }
.sum-total .v { font-size: 26px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.disc-row { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.disc-row input[type=range] { flex: 1; accent-color: var(--navy); }
.disc-val { font-variant-numeric: tabular-nums; font-weight: 600; width: 52px; text-align: right; }
.alert { border-radius: 8px; padding: 10px 12px; font-size: 12.5px; line-height: 1.55; margin-top: 12px; }
.alert.warn { background: #fdf6e7; color: #8a5c07; border: 1px solid #f3e2bb; }
.alert.danger { background: #fdecea; color: #a52a20; border: 1px solid #f6cdc8; }
.alert.ok { background: #eaf6ef; color: #17694a; border: 1px solid #cbe6d7; }
.alert ul { margin: 4px 0 0; padding-left: 16px; }
.aside .actions { display: flex; flex-direction: column; gap: 8px; }
.aside .actions .btn { width: 100%; }

/* 审批弹层 */
.modal-bg { position: fixed; inset: 0; background: rgba(14,36,56,.45); display: grid; place-items: center; z-index: 60; padding: 20px; }
.modal { background: #fff; border-radius: 12px; width: 100%; max-width: 420px; box-shadow: 0 20px 60px rgba(0,0,0,.24); }
.modal .hd { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 600; }
.modal .bd { padding: 18px 20px; }
.modal .ft { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }

.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px); background: var(--navy); color: #fff;
  padding: 10px 20px; border-radius: 8px; font-size: 13.5px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 90; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--red); }

/* 看板 */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin-bottom: 18px; }
.kpi { background: #fff; border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; }
.kpi .k { font-size: 12.5px; color: var(--muted); }
.kpi .v { font-size: 25px; font-weight: 600; margin-top: 4px; font-variant-numeric: tabular-nums; letter-spacing: -.5px; }
.kpi .v small { font-size: 13px; font-weight: 400; color: var(--muted); margin-left: 3px; }

/* ---------------- 报价系统（第 0 步 / 列表 / 后台） ---------------- */
/* 归档只读：原则是「看得清、改不了」——不再灰化 / 降透明度（那会妨碍阅读数据），
   只把交互层挡掉，并让禁用控件保持正文色，视觉上接近纯文本展示 */
.editor-main > section.locked > .hd button,
.editor-main > section.locked > .bd button,
.editor-main > section.locked .up-zone,
.editor-main > section.locked [data-act] { pointer-events: none; }
.editor-main > section.locked input:disabled,
.editor-main > section.locked select:disabled,
.editor-main > section.locked textarea:disabled { background: #f6f8fa; color: var(--text); opacity: 1; -webkit-text-fill-color: var(--text); }
/* 已归档只读横幅：居中=no，紧跟页头，说明「为什么不能改」 */
.arch-banner {
  margin: 0 0 14px; padding: 12px 16px; border: 1px solid #d9e2ec; border-left: 4px solid #6b7a8d;
  border-radius: 10px; background: #f7f9fb;
}
.arch-banner-main { display: flex; align-items: center; gap: 10px; }
.arch-banner-main b { color: var(--text); }
.arch-banner-sub { margin-top: 6px; font-size: 12.5px; line-height: 1.7; color: var(--muted); }
.card.step0 { border-color: #cddcec; box-shadow: 0 1px 2px rgba(16,38,60,.05); }
.card.step0 .hd h3 { color: var(--navy); }
.sys-hint { font-size: 12.5px; color: var(--muted); margin-bottom: 12px; }
.sys-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.sys-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--c, var(--navy));
  border-radius: 10px; padding: 12px 14px; transition: all .15s;
}
.sys-card:hover { border-color: var(--c, var(--blue)); box-shadow: var(--shadow); transform: translateY(-1px); }
.sy-ico {
  width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center;
  font-size: 18px; background: #f1f5fa; background: color-mix(in srgb, var(--c, #12395e) 12%, #fff);
  color: var(--c, #12395e); line-height: 1;
}
.sy-ico.sm { width: 28px; height: 28px; font-size: 15px; border-radius: 8px; }
.sy-name { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.sy-name .pill { font-size: 11px; padding: 1px 7px; }
.sy-desc { font-size: 12px; color: var(--muted); line-height: 1.5; }
.sy-enc { font-size: 12px; color: var(--c, var(--blue)); margin-top: 2px; }
.sys-cur {
  display: flex; align-items: flex-start; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 4px solid var(--c, var(--navy));
  border-radius: 10px; padding: 12px 14px; background: #f8fafc; background: color-mix(in srgb, var(--c, #12395e) 4%, #fff);
}
.sy-steps { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; align-self: center; }
.sy-steps .tag {
  font-size: 11.5px; padding: 2px 9px; border-radius: 20px; background: #fff;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.sys-pill {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 1px 9px;
  border-radius: 20px; background: #eef3f9; background: color-mix(in srgb, var(--c, #12395e) 10%, #fff);
  color: var(--c, #12395e); border: 1px solid color-mix(in srgb, var(--c, #12395e) 25%, #fff);
  white-space: nowrap;
}
#sysPickBox .empty { padding: 18px; }

@media (max-width: 1100px) {
  .editor { grid-template-columns: 1fr; }
  .aside { position: static; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side-hide { display: none; }
  body.side-hidden .side-show { display: none; }
  body.side-hidden .side { display: flex; }
  .side { flex-direction: row; align-items: center; padding: 10px; overflow-x: auto; }
  .side .brand { padding: 0 12px 0 4px; }
  .side .brand span { display: none; }
  .nav { flex-direction: row; }
  .side .foot { margin: 0 0 0 auto; border: 0; padding: 0 6px; display: flex; align-items: center; gap: 10px; }
  .side .foot .role { display: none; }
  .main { padding: 16px; }
  .login-wrap { flex-direction: column; }
  .login-brand { padding: 32px; }
  .login-brand h1 { font-size: 28px; }
  .grid2, .grid3, .grid4, .host-pick { grid-template-columns: 1fr; }
  .cust-grid { grid-template-columns: 1fr; }
  .hd-pick { margin-left: 0; width: 100%; }
}

/* ---------------- 报价数据维护（大项 + 明细行） ---------------- */
.cat-grid { display: flex; gap: 14px; align-items: flex-start; }
.cat-side { width: 330px; flex: none; }
.cat-side table.list td { padding: 9px 10px; }
.cat-side table.list tr.on td { background: #eef4fb; }
/* 列宽之和（34+290+118+200+64+96+170+100+92+130）；fixed 布局下必须给显式宽度，
   否则 Chrome 会把表格撑满容器、各列被等比压扁导致输入框显示不全。改 th 宽度时同步这里。 */
table.cat-items { table-layout: fixed; width: 1294px; max-width: none; }
.cat-items th, .cat-items td { padding: 7px 6px; }
.cat-items thead th:first-child, .cat-items tbody td:first-child { padding-left: 2px; }
.cat-items tbody tr:hover { background: transparent; cursor: default; }
.cat-inp { width: 100%; min-width: 0; padding: 6px 5px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 13px; color: var(--text); background: #fff; }
.cat-inp:focus { outline: none; border-color: var(--navy); background: #fbfdff; }
@media (max-width: 1100px) {
  .cat-grid { flex-direction: column; }
  .cat-side { width: 100%; }
}
/* 列宽由表头 th 的 width 决定（table-layout: fixed） */

/* ---------------- 方案预览（弹窗，列表 / 编辑器共用） ----------------
   宽屏弹窗 + 内容区独立滚动：明细再多也不撑破页面，头部与底部按钮始终可见。 */
.modal.pv-modal { max-width: 1060px; max-height: 88vh; display: flex; flex-direction: column; }
.pv-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pv-hd .pill { margin-left: 8px; }
.pv-no { color: var(--muted); font-weight: 400; font-size: 13px; margin-left: 4px; }
.pv-body { overflow: auto; padding: 14px 18px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(215px, 1fr)); gap: 10px 18px; margin-bottom: 14px; }
.pv-i label { display: block; font-size: 11.5px; color: var(--muted); margin-bottom: 1px; }
.pv-i > div { font-size: 13px; }
.pv-table { width: 100%; }
/* 预览是只读视图：不显示可点击手型，行高收紧，明细多也能一屏看完更多 */
.pv-table th, .pv-table td { padding: 7px 9px; }
.pv-table tbody tr:hover { background: transparent; cursor: default; }
.pv-table tbody tr.pv-grp:hover { background: #f5f8fb; }
.pv-table th { font-size: 12px; }
.pv-table td { font-size: 12.8px; }
.pv-grp td { background: #f5f8fb; font-weight: 600; }
.pv-gsum { float: right; font-weight: 600; }
.pv-sub td { color: var(--muted); }
.pv-note-cell { color: var(--muted); font-size: 12px; }
.pv-foot { display: flex; gap: 24px; align-items: flex-start; margin-top: 14px; flex-wrap: wrap; }
.pv-sum { flex: 0 0 330px; }
.pv-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 13px; }
.pv-total { border-top: 1px solid var(--line); font-weight: 700; font-size: 15px; padding-top: 8px; margin-top: 4px; }
.pv-extra { flex: 1; min-width: 240px; }
.pv-extra .pv-i + .pv-i { margin-top: 8px; }
.pv-note > div { white-space: pre-wrap; }
.pv-ft { display: flex; align-items: center; gap: 8px; }
.pv-tip { margin-right: auto; font-size: 12px; color: var(--muted); }
/* 列表里的预览入口：客户名 / 项目名仍可点（无额外视觉），常驻入口放在独立的「预览」列 */
.pv-cust { display: inline-block; cursor: pointer; font-weight: 500; }
.pv-cust:hover, .pv-proj:hover { color: var(--navy); text-decoration: underline; }
.pv-proj { display: inline-block; cursor: pointer; color: var(--muted); font-size: 12px; line-height: 1.5; }
/* 「预览」列：窄列 + 文字型入口，列头与单元格同左缘对齐；收紧内边距，不挤压相邻列 */
table.list th.pv-col, table.list td.pv-col { width: 28px; padding-left: 0; padding-right: 12px; }
table.list td.pv-col { white-space: nowrap; }
.pv-link {
  display: inline-block; border: 0; background: none; margin: 0; padding: 0;
  font: inherit; font-size: 12.5px; line-height: inherit; color: var(--navy);
  cursor: pointer; border-radius: 3px;
}
.pv-link:hover { text-decoration: underline; }
.pv-link:active { opacity: .7; }
.pv-link:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }

/* 归档入口：跟在归档状态胶囊后面，与旁边的金额/时间保持同一行基线 */
.pv-linkbtns { display: inline-block; margin-left: 8px; white-space: nowrap; }
.pv-linkbtns .pv-link { font-size: 12px; color: var(--muted); }
.pv-linkbtns .pv-link:hover { color: var(--navy); }
.pv-linkbtns .pv-link + .pv-link { margin-left: 6px; }
.pv-linkbtns .pv-link.ok { color: var(--green); }
.pv-linkbtns .pv-link.ok:hover { color: var(--green); }
.pv-linkbtns .pv-link.danger { color: var(--red); }
.pv-linkbtns .pv-link.danger:hover { color: var(--red); }
