:root { --c: #1f6feb; --c-soft: #eef3ff; }
* { box-sizing: border-box; }
body { margin: 0; font-family: "PingFang SC","Microsoft YaHei",-apple-system,"Helvetica Neue",Arial,sans-serif;
  color: #1f2430; background: #f5f7fa; font-size: 14px; }
a { color: var(--c); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
.btn { background: var(--c); color: #fff; border: 0; padding: 8px 14px; border-radius: 6px; font-size: 13px; }
.btn:hover { filter: brightness(1.05); }
.btn.ghost { background: #fff; color: var(--c); border: 1px solid var(--c); }
.btn.gray { background: #6b7280; }
.btn.gray.on { background: var(--c); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.input, select, textarea { width: 100%; padding: 8px 10px; border: 1px solid #d4d9e0; border-radius: 6px;
  font-size: 13px; font-family: inherit; background: #fff; }
.input:focus, textarea:focus, select:focus { outline: none; border-color: var(--c); }
label { display: block; font-size: 12px; color: #555; margin: 10px 0 4px; font-weight: 600; }

/* 顶栏 */
.topbar { background: #fff; border-bottom: 1px solid #e6e9ee; padding: 10px 20px; display: flex;
  align-items: center; gap: 14px; position: sticky; top: 0; z-index: 20; }
.topbar .logo { max-height: 34px; }
.topbar .co { font-weight: 800; font-size: 17px; color: var(--c); }
.topbar .spacer { flex: 1; }
.topbar .link { color: #555; font-size: 13px; }
/* 后台管理入口：做成小按钮样式，点击区域更明确 */
.topbar .admin-link { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px;
  font-size: 13px; font-weight: 600; color: var(--c); background: var(--c-soft);
  border: 1px solid transparent; border-radius: 6px; transition: background .15s, border-color .15s; }
.topbar .admin-link:hover { background: #fff; border-color: var(--c); }
.topbar .admin-link .ico { width: 14px; height: 14px; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; padding: 14px 20px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.toolbar .count { color: #666; font-size: 12px; }

/* 产品网格 */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; padding: 0 20px 30px; }
.card { background: #fff; border: 1px solid #e9edf2; border-radius: 10px; overflow: hidden; position: relative;
  transition: box-shadow .15s, transform .15s; cursor: pointer; }
.card:hover { box-shadow: 0 6px 18px rgba(0,0,0,.08); transform: translateY(-2px); }
.card .sel { position: absolute; top: 8px; left: 8px; z-index: 2; }
.card .sel input { width: 18px; height: 18px; cursor: pointer; }
.card .thumb { height: 150px; background: #fafbfc; display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid #f0f2f5; }
.card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.card .thumb .ph { color: #c2c8d0; font-size: 13px; }
.gallery { display: flex; flex-wrap: wrap; gap: 10px; }
.gallery img, .modal .zoom { max-width: 160px; max-height: 130px; object-fit: contain; border: 1px solid #eee;
  border-radius: 6px; background: #fafafa; cursor: zoom-in; transition: transform .1s; }
.gallery img:hover, .modal .zoom:hover { transform: scale(1.03); }
.lightbox { position: fixed; inset: 0; background: rgba(0,0,0,.82); display: none; align-items: center; justify-content: center;
  z-index: 200; cursor: zoom-out; padding: 24px; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 94vw; max-height: 94vh; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.5); }
.card .body { padding: 10px 12px; }
.card .nm { font-weight: 700; font-size: 14px; line-height: 1.35; height: 38px; overflow: hidden; }
.card .spec { color: #555; font-size: 12px; margin: 4px 0; }
.card .pr { color: var(--c); font-weight: 700; font-size: 14px; }
.card .acts { display: flex; gap: 8px; margin-top: 8px; }
.card .acts a, .card .acts button { font-size: 12px; }

/* 详情弹层 */
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: none; z-index: 50; }
.modal.open { display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; overflow: auto; }
.modal .panel { background: #fff; border-radius: 12px; max-width: 720px; width: 100%; padding: 22px 24px; }
.modal .panel h2 { margin: 0 0 4px; }
.modal .close { float: right; font-size: 22px; color: #999; cursor: pointer; line-height: 1; }
table.params { width: 100%; border-collapse: collapse; margin: 10px 0; }
table.params td { border: 1px solid #e8ebef; padding: 7px 10px; vertical-align: top; font-size: 13px; }
table.params td.k { width: 120px; background: #f7f9fb; color: #555; font-weight: 600; }
.filelist { margin-top: 8px; }
.filelist .fitem { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #dde3ea; border-radius: 6px;
  padding: 5px 10px; margin: 4px 6px 4px 0; font-size: 12px; background: #fafbfc; }
.gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.gallery img { width: 150px; height: 150px; object-fit: contain; border: 1px solid #eee; border-radius: 6px;
  background: #fafafa; cursor: pointer; }
.cfg { margin-top: 10px; padding: 8px 10px; background: #f7f9fb; border-radius: 6px; color: #444; font-size: 13px; }

/* 产品详情信息区块：简约统一风格（白底细线，少用色） */
.dblocks { margin-top: 4px; }
.dblock { padding: 10px 2px; margin: 0; font-size: 13px; line-height: 1.7; color: #333;
  border-bottom: 1px solid #eef0f3; }
.dblock:last-child { border-bottom: none; }
.dblock-h { display: flex; align-items: center; gap: 7px; font-weight: 600; font-size: 13px;
  color: #222; margin-bottom: 5px; letter-spacing: .3px; }
.dblock-h::before { content: ''; width: 3px; height: 13px; background: #888; border-radius: 2px; }
.dblock-ico { display: none; }  /* 简约：去掉彩色圆点图标，用细竖线代替 */
.dblock-body { white-space: pre-line; color: #444; }
.dblock-params table.params { margin: 6px 0 0; }
.dblock-caution .dblock-h { color: #a4441a; }
.dblock-caution .dblock-h::before { background: #d9743a; }
.dblock-usage summary.dblock-h { cursor: pointer; list-style: none; user-select: none; }
.dblock-usage summary.dblock-h::-webkit-details-marker { display: none; }
.dblock-usage summary.dblock-h::after { content: '▾'; margin-left: 2px; font-size: 11px; color: #999; transition: transform .15s; }
.dblock-more { margin-left: auto; font-weight: 400; font-size: 11px; color: #aaa; }
.dblock-usage[open] .dblock-more { display: none; }
.dblock-usage[open] summary.dblock-h::after { transform: rotate(180deg); }

/* 产品弹窗里的上架状态开关 */
.fs-status label { display: block; margin: 0 0 6px; font-size: 13px; color: #555; font-weight: 600; }
.fs-status .switch { font-size: 13px; }

/* ============ 后台产品卡片（与客户前台同一套卡片样式） ============ */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.adm-card { cursor: default; display: flex; flex-direction: column; }
.adm-card .thumb { height: 140px; }
.adm-card.off .thumb img { filter: grayscale(1); opacity: .55; }
.adm-card.off .nm { color: #8b95a3; }
.adm-card .off-tag { position: absolute; top: 8px; right: 8px; z-index: 2; background: rgba(15,23,42,.72);
  color: #fff; font-size: 11px; padding: 2px 9px; border-radius: 10px; }
.adm-card .body { display: flex; flex-direction: column; flex: 1; }
.adm-card .cat { color: #98a2b3; font-size: 11px; margin-top: 2px; }
.adm-card .card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin-top: auto; padding-top: 10px; border-top: 1px solid #f0f2f5; }
.adm-card .card-foot .btn { padding: 5px 12px; font-size: 12px; border-radius: 5px; }

/* 上/下架开关 */
.switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin: 0; font-weight: 500; font-size: 12px; color: #555; }
.switch input { display: none; }
.switch .track { width: 34px; height: 18px; border-radius: 10px; background: #cfd6e0; position: relative;
  transition: background .18s; flex: none; }
.switch .knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; transition: left .18s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .track { background: var(--c); }
.switch input:checked + .track .knob { left: 18px; }
.switch .sw-label { min-width: 34px; }
.switch.on .sw-label { color: var(--c); }

/* ============ 后台产品详情弹窗（样式同客户前台详情，可编辑） ============ */
.modal .panel.pm-panel { max-width: 880px; padding: 20px 24px 18px; }
.pm-title { padding-right: 26px; }
.pm-title .pm-name { font-size: 19px; font-weight: 800; padding: 7px 10px; }
.pm-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 12px; margin-top: 12px; }
.pm-meta label { display: block; margin: 0; font-size: 12px; color: #555; font-weight: 600; }
.pm-meta .input { margin-top: 4px; }
.pm-sec { margin-top: 16px; padding-top: 14px; border-top: 1px solid #eef1f5; }
.pm-sec > b { font-size: 13px; }
.pm-sec .hint { display: block; margin: 2px 0 8px; }
.pm-params { width: 100%; border-collapse: collapse; margin: 8px 0; }
.pm-params td { border: 1px solid #e8ebef; padding: 4px 8px; vertical-align: middle; }
.pm-params td.k { width: 170px; background: #f7f9fb; }
.pm-params td.k input { border: 0; background: transparent; padding: 4px 2px; font-weight: 600; }
.pm-params td.k input:focus { outline: none; }
.pm-params .kvrow { display: table-row; margin: 0; gap: 0; }
.pm-params .del { background: #fde8e8; color: #c0392b; border: 0; border-radius: 5px; padding: 4px 9px; }
.pm-params .pdel { width: 46px; text-align: center; }
.pm-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding: 12px 0 0;
  border-top: 1px solid #eef1f5; position: sticky; bottom: -18px; background: #fff; z-index: 3; }
.pm-foot .spacer { flex: 1; }

/* ============ 统一图标（内联 SVG，stroke 跟随文字颜色） ============ */
.ico { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; }

/* 侧栏 */
.sb-item .ic { width: 18px; height: 18px; display: inline-flex; align-items: center;
  justify-content: center; flex: none; }
.sb-item .ic .ico { width: 16px; height: 16px; }
.sb-garrow { display: inline-flex; align-items: center; justify-content: center; transition: transform .18s; }
.sb-garrow .ico { width: 13px; height: 13px; }
.sb-group.folded .sb-garrow { transform: rotate(-90deg); }

/* 折叠箭头：收起时朝右，展开时朝下（带过渡动画） */
.chev { transition: transform .18s ease; }
.tree-toggle .chev, .sb-item .ic .chev { transform: rotate(-90deg); }
.tree-toggle.open .chev, .sb-item .ic.open .chev, .sb-item .ic .chev.open { transform: rotate(0deg); }
.tree-toggle { width: 14px; flex: none; display: inline-flex; align-items: center;
  justify-content: center; color: #7c8aa0; }
.tree-toggle .chev { width: 12px; height: 12px; }
.tree-dot { width: 14px; flex: none; display: inline-flex; align-items: center; justify-content: center; }
.tree-dot::after { content: ''; width: 3px; height: 3px; border-radius: 50%; background: #55627a; }

/* 带图标的按钮/标题：图标与文字垂直居中对齐 */
.tb-back, .tb-btn, .qt-back, .print-bar button, .ws-menu, .btn-ico {
  display: inline-flex; align-items: center; gap: 6px; }
.tb-back .ico, .tb-btn .ico, .qt-back .ico { width: 14px; height: 14px; }
.ws-menu .ico { width: 18px; height: 18px; }
.print-bar button .ico { width: 14px; height: 14px; }

/* 后台布局 */
.admin { display: grid; grid-template-columns: 340px 1fr; min-height: 100vh; }
.admin .side { background: #fff; border-right: 1px solid #e6e9ee; padding: 16px; overflow: auto; }
.admin .main { padding: 18px 22px; overflow: auto; }
.admin .plist { list-style: none; margin: 0; padding: 0; }
.admin .plist li { display: flex; align-items: center; gap: 8px; padding: 9px 10px; border-radius: 7px; cursor: pointer; }
.admin .plist li:hover, .admin .plist li.active { background: var(--c-soft); }
.admin .plist .nm { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin .plist .mini { font-size: 11px; color: #999; }
.kvrow { display: flex; gap: 8px; margin: 6px 0; align-items: center; }
.kvrow .input { flex: 1; }
.kvrow .del { background: #fde8e8; color: #c0392b; border: 0; border-radius: 5px; padding: 6px 9px; }
.uploadrow { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 6px; }
.uploadrow .up { border: 1px dashed #c7d0db; border-radius: 8px; padding: 10px; flex: 1; min-width: 160px; }
.preview-img { max-width: 160px; max-height: 120px; border: 1px solid #eee; border-radius: 6px; margin-top: 6px; }
.section { background: #fff; border: 1px solid #e9edf2; border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; }
.section h3 { margin: 0 0 6px; font-size: 15px; }
.hint { color: #888; font-size: 12px; }

/* 报价单编辑 */
.qt-wrap { max-width: 1500px; margin: 0 auto; padding: 64px 20px 20px; }

/* 统一文档工具栏（与「导出客户资料 PDF」页面的工具栏保持一致） */
.docbar { position: fixed; top: 0; left: 0; right: 0; z-index: 99; background: #1f2937; color: #fff;
  padding: 10px 16px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; font-size: 13px; }
.docbar .tb-back { color: #cbd5e1; font-size: 13px; }
.docbar .tb-back:hover { color: #fff; }
.docbar .tb-title { font-weight: 800; font-size: 15px; color: #fff; }
.docbar .tb-spacer { flex: 1; }
.docbar .tb-btn { background: var(--c); color: #fff; border: 0; padding: 7px 14px; border-radius: 5px;
  cursor: pointer; font-size: 13px; }
.docbar .tb-btn:hover { filter: brightness(1.08); }
.docbar .tb-btn.on { background: #fff; color: var(--c); font-weight: 600; }
.docbar .hint { color: #cbd5e1; }
.docbar .wm-toggle { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #cbd5e1; cursor: pointer; }
.docbar .wm-toggle input { width: 14px; height: 14px; }
.qt-info { display: flex; align-items: flex-end; gap: 18px; flex-wrap: wrap; margin-bottom: 14px; }
.qt-info .qt-field { display: flex; align-items: center; gap: 8px; margin: 0; }
.qt-info .qt-field .input { width: 180px; }
.qt-info .hint { margin-bottom: 8px; }
.qt-back { background: none; border: 0; padding: 0; color: var(--c); font-size: 12px; font-weight: 600; }
.qt-back:hover { text-decoration: underline; }
.qt-from { margin: 0 0 14px; padding: 9px 13px; background: #eef6ff; border: 1px solid #cfe3ff;
           border-left: 3px solid var(--c); border-radius: 6px; color: #334155; font-size: 12.5px; }
.qt-pv-head { padding: 8px 14px; font-size: 12px; border: 1px solid #e9edf2; border-bottom: 0;
              border-radius: 10px 10px 0 0; background: #fff; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.qt-pv-head .hint { font-weight: 400; color: #6b7280; }
#stepPreview iframe { width: 100%; height: calc(100vh - 150px); min-height: 620px; border: 1px solid #e9edf2;
                      border-radius: 0 0 10px 10px; display: block; background: #f5f6f8; }
@media (max-width: 1100px) {
  #stepPreview iframe { height: 70vh; }
}
.qt-meta { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px,1fr)); gap: 12px; }
table.qt { width: 100%; border-collapse: collapse; margin-top: 14px; }
table.qt th, table.qt td { border: 1px solid #dfe4ea; padding: 8px 9px; font-size: 13px; }
table.qt th { background: var(--c); color: #fff; }
table.qt td input { width: 80px; }
table.qt td.amt { text-align: right; font-weight: 700; }
table.qt tr.total td { font-weight: 800; background: #f7f9fb; }
table.qt tr.total td.r { text-align: right; color: var(--c); font-size: 15px; }

/* 密钥遮罩 */
.keymask { position: fixed; inset: 0; background: rgba(15,23,42,.6); display: flex; align-items: center;
  justify-content: center; z-index: 80; }
.keymask .box { background: #fff; padding: 24px 28px; border-radius: 12px; width: 320px; }
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: #1f2937; color: #fff;
  padding: 10px 18px; border-radius: 8px; font-size: 13px; z-index: 99; opacity: 0; transition: opacity .2s; }
.imp-ok, .imp-err, .imp-warn { padding: 12px 14px; border-radius: 7px; font-size: 13px; line-height: 1.7; }
.imp-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.imp-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.imp-warn { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; margin-top: 8px; }
input[type=file].input { padding: 7px 8px; font-size: 12px; }

.toast.show { opacity: 1; }

/* ---------- 报价单页：多方报价 ---------- */
.qt-parties { display: flex; flex-direction: column; gap: 8px; }
.qt-party { display: grid; grid-template-columns: minmax(160px,1fr) 220px 1fr; gap: 10px; align-items: center;
  padding: 9px 12px; border: 1px solid #e6eaef; border-radius: 8px; background: #fbfcfd; }
.qt-party.on { border-color: var(--c); background: #f2f7ff; }
.qt-party .qp-chk { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.qt-party .qp-chk input { width: 16px; height: 16px; }
.qt-party .hint { font-size: 12px; }
@media (max-width: 720px) { .qt-party { grid-template-columns: 1fr; } }

/* ---------- 模板管理 ---------- */
.tpl-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.tpl-tab { padding: 7px 16px; border: 1px solid #dde3ea; border-radius: 20px; background: #fff; cursor: pointer; font-size: 13px; color: #555; }
.tpl-tab.on { background: var(--c); border-color: var(--c); color: #fff; font-weight: 600; }
.tpl-wrap { display: grid; grid-template-columns: 250px 1fr; gap: 16px; align-items: start; }
.tpl-side { background: #fff; border: 1px solid #e9edf2; border-radius: 10px; padding: 12px; }
.tpl-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; max-height: 60vh; overflow: auto; }
.tpl-item { border: 1px solid #e6eaef; border-radius: 8px; padding: 8px 10px; cursor: pointer; background: #fbfcfd; }
.tpl-item:hover { border-color: var(--c); }
.tpl-item.on { border-color: var(--c); background: #f2f7ff; }
.tpl-nm { font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.tpl-def { font-size: 10px; background: var(--c); color: #fff; padding: 1px 6px; border-radius: 8px; font-weight: 400; }
.tpl-ops { display: flex; gap: 8px; margin-top: 5px; }
.tpl-ops button { border: 0; background: none; color: #6b7a90; font-size: 11px; cursor: pointer; padding: 0; }
.tpl-ops button:hover { color: var(--c); text-decoration: underline; }
.tpl-main { display: grid; grid-template-columns: minmax(280px, 420px) 1fr; gap: 16px; align-items: start; }
.tpl-form { background: #fff; border: 1px solid #e9edf2; border-radius: 10px; padding: 14px; }
.tpl-fld { display: block; font-size: 12px; color: #555; margin-bottom: 10px; }
.tpl-fld .input { margin-top: 4px; }
.tpl-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.tpl-chks { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-bottom: 10px; }
.tpl-chk { font-size: 12px; color: #444; display: flex; align-items: center; gap: 5px; }
.tpl-chk input { width: 15px; height: 15px; }
.tpl-sec { font-size: 12px; font-weight: 700; color: var(--c); display: block; margin: 6px 0 8px; }
.tpl-actions { display: flex; gap: 10px; margin-top: 6px; }
.tpl-pv { background: #fff; border: 1px solid #e9edf2; border-radius: 10px; overflow: hidden; }
.tpl-pv-head { padding: 8px 12px; font-size: 12px; font-weight: 600; border-bottom: 1px solid #eef1f5; display: flex; gap: 10px; align-items: center; }
.tpl-pv iframe { width: 100%; height: 640px; border: 0; display: block; background: #f5f6f8; }

/* ---------- 产品图集（拖拽排序，第一张为主图） ---------- */
.img-gallery { display: flex; flex-wrap: wrap; gap: 10px; padding: 8px; min-height: 64px;
  border: 1px dashed #d8dee6; border-radius: 8px; background: #fbfcfd; }
.img-gallery .hint { align-self: center; }
.ig-item { position: relative; width: 104px; height: 104px; border-radius: 8px; overflow: hidden;
  border: 2px solid #e6eaef; background: #fff; cursor: grab; transition: border-color .15s, transform .15s, box-shadow .15s; }
.ig-item:hover { border-color: var(--c); box-shadow: 0 3px 10px rgba(0,0,0,.08); }
.ig-item.dragging { opacity: .45; cursor: grabbing; }
.ig-item.over { border-color: var(--c); transform: scale(1.04); }
.ig-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.ig-badge { position: absolute; left: 0; top: 0; background: var(--c); color: #fff; font-size: 11px;
  padding: 2px 7px; border-bottom-right-radius: 6px; }
.ig-ord { position: absolute; right: 4px; top: 4px; background: rgba(0,0,0,.55); color: #fff;
  font-size: 11px; width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 50%; }
.ig-del { position: absolute; right: 4px; bottom: 4px; width: 20px; height: 20px; line-height: 18px;
  border: 0; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; cursor: pointer; font-size: 14px; padding: 0; }
.ig-del:hover { background: #e5484d; }
.ig-zoom { position: absolute; left: 4px; bottom: 4px; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 4px; background: rgba(0,0,0,.45); color: #fff; cursor: pointer; padding: 0; }
.ig-zoom .ico { width: 12px; height: 12px; }
.ig-zoom:hover { background: rgba(0,0,0,.7); }
.ig-broken { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; background: #f4f6f8; color: #a8b0bd; font-size: 11px; }
.ig-broken .ico { width: 20px; height: 20px; }
.ig-broken em { font-style: normal; }
.img-broken { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 150px; height: 150px; border: 1px solid #eee; border-radius: 6px; background: #f4f6f8; color: #a8b0bd; font-size: 12px; }
.img-broken .ico { width: 24px; height: 24px; }
.img-broken em { font-style: normal; }

/* ===== 新版后台：左侧导航 + 右侧工作区 ===== */
.admin-shell { display: flex; min-height: 100vh; }
.sidebar { width: 248px; flex: none; background: #111827; color: #cbd5e1; display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh; transition: width .18s; overflow: hidden; }
.sb-brand { display: flex; align-items: center; gap: 11px; padding: 18px 16px; border-bottom: 1px solid #1f2937; }
.sb-logo { width: 36px; height: 36px; flex: none; border-radius: 8px; background: var(--c); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 17px; overflow: hidden; }
.sb-logo img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.sb-title { font-size: 15px; font-weight: 800; color: #fff; line-height: 1.2; }
.sb-sub { font-size: 11px; color: #8b95a6; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.sb-nav { flex: 1; overflow: auto; padding: 10px 8px 20px; }
.sb-group { font-size: 10px; letter-spacing: 1px; color: #6b7280; text-transform: uppercase;
  padding: 16px 10px 6px; font-weight: 700; display: flex; align-items: center; justify-content: space-between;
  cursor: pointer; user-select: none; }
.sb-group:hover { color: #cbd5e1; }
.sb-garrow { font-size: 11px; transition: transform .15s; }
.sb-group.folded .sb-garrow { transform: rotate(-90deg); }
.sb-group-body { /* 折叠由 JS 控制 display */ }
.sb-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-radius: 7px;
  color: #cbd5e1; font-size: 13px; cursor: pointer; user-select: none; white-space: nowrap; }
.sb-item:hover { background: #1f2937; color: #fff; }
.sb-item.active { background: var(--c); color: #fff; }
.sb-item .ic { width: 18px; text-align: center; font-size: 14px; flex: none; }
.sb-badge { margin-left: auto; background: #374151; color: #d1d5db; font-size: 11px;
  padding: 1px 7px; border-radius: 10px; }
.sb-badge:empty { display: none; }
.sb-item.active .sb-badge { background: rgba(255,255,255,.22); color: #fff; }
.sb-tree { margin: 2px 0; }
.tree-row { display: flex; align-items: center; gap: 5px; padding: 6px 8px; border-radius: 6px;
  font-size: 12.5px; color: #aab3c0; cursor: pointer; white-space: nowrap; }
.tree-row:hover { background: #1f2937; color: #fff; }
.tree-row.active { background: #1e3a8a; color: #fff; }
.tree-toggle { width: 14px; flex: none; color: #7c8aa0; font-size: 10px; }
.tree-dot { width: 14px; flex: none; text-align: center; color: #4b5563; }
.tree-name { overflow: hidden; text-overflow: ellipsis; }
.sb-empty { padding: 6px 12px; font-size: 12px; color: #6b7280; }
.sb-foot { padding: 10px 8px 16px; border-top: 1px solid #1f2937; }
.sb-foot .sb-item { color: #93a3b8; }
/* 收起态 */
.sidebar.collapsed { width: 0; }
body.sb-hide .sb-brand > div:last-child, body.sb-hide .sb-group,
body.sb-hide .sb-item, body.sb-hide .sb-tree, body.sb-hide .sb-badge { opacity: 0; pointer-events: none; }

.workspace { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ws-topbar { height: 54px; flex: none; background: #fff; border-bottom: 1px solid #e6e9ee;
  display: flex; align-items: center; gap: 12px; padding: 0 22px; position: sticky; top: 0; z-index: 10; }
.ws-menu { background: none; border: 0; font-size: 18px; color: #6b7280; padding: 4px 8px; border-radius: 5px; }
.ws-menu:hover { background: #f1f5f9; }
.ws-crumb { font-size: 13px; color: #6b7280; }
.ws-spacer { flex: 1; }
.ws-search { width: 240px; padding: 7px 11px; border: 1px solid #d4d9e0; border-radius: 6px; font-size: 13px; }
.ws-main { padding: 22px 26px 50px; overflow: auto; flex: 1; }
.ws-head { margin-bottom: 18px; }
.ws-head h2 { margin: 0 0 4px; font-size: 20px; }
.ws-head p { margin: 0; }
.ws-count { font-size: 12px; font-weight: 500; color: #6b7280; background: #f1f5f9;
  padding: 2px 9px; border-radius: 10px; vertical-align: middle; margin-left: 6px; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: #fff; border: 1px solid #e9edf2; border-radius: 10px; padding: 18px 20px; }
.stat-n { font-size: 30px; font-weight: 800; color: var(--c); line-height: 1; }
.stat-l { font-size: 12px; color: #6b7280; margin-top: 8px; }
.quick-row { display: flex; gap: 10px; flex-wrap: wrap; }
code { background: #f1f5f9; padding: 1px 5px; border-radius: 4px; font-size: 12px; color: #b91c1c; }

.adm-table { width: 100%; border-collapse: collapse; }
.adm-table th, .adm-table td { padding: 10px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid #eef1f5; }
.adm-table th { background: #f7f9fb; color: #6b7280; font-weight: 600; font-size: 12px; }
.adm-table tr:last-child td { border-bottom: 0; }
.adm-table tr:hover td { background: #fafbfc; }
.tbl-thumb { width: 40px; height: 40px; object-fit: contain; border-radius: 5px; border: 1px solid #eee; }
.pill { font-size: 11px; padding: 2px 9px; border-radius: 10px; }
.pill.on { background: #dcfce7; color: #15803d; }
.pill.off { background: #f1f5f9; color: #6b7280; }
.lnk-btn { background: none; border: 0; color: var(--c); font-size: 13px; padding: 2px 4px; }
.lnk-btn:hover { text-decoration: underline; }
.empty-box { padding: 40px; text-align: center; color: #9aa3b0; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 14px; }
/* 统一上传区：图片 / 视频 / 文档一个入口，服务端按扩展名自动分类 */
.upload-zone { position: relative; margin-top: 12px; border: 1.5px dashed #c7d0db; border-radius: 10px;
  background: #fafbfc; transition: border-color .15s, background .15s; }
.upload-zone:hover { border-color: var(--c); background: var(--c-soft); }
.upload-zone.over { border-color: var(--c); background: var(--c-soft); box-shadow: 0 0 0 3px rgba(31,111,235,.12); }
.upload-zone.is-off { opacity: .6; pointer-events: none; }
.upload-zone > input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0;
  cursor: pointer; font-size: 12px; }
.upload-zone > input[type=file]:disabled { cursor: not-allowed; }
.up-zone-in { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 18px 14px; text-align: center; pointer-events: none; }
.up-zone-in .ico { width: 22px; height: 22px; color: var(--c); }
.up-zone-t { font-size: 13px; font-weight: 600; color: #33415c; }
.up-zone-s { font-size: 12px; color: #8a94a6; }
.form-actions { display: flex; gap: 10px; padding: 6px 0 20px; }

.fitem a { margin-left: 4px; }
.fitem a.fdel { color: #c0392b; }
.steps { line-height: 2; color: #444; }
.code-box { background: #1f2937; color: #e5e7eb; padding: 14px 16px; border-radius: 8px;
  font-size: 12.5px; line-height: 1.7; overflow: auto; }

/* 视频预览 */
.video-wrap { display: flex; flex-wrap: wrap; gap: 12px; }
.video-card { border: 1px solid #e3e7ed; border-radius: 8px; overflow: hidden; background: #000; width: 260px; }
.video-card video { width: 100%; display: block; background: #000; }
.video-card .vbar { display: flex; align-items: center; justify-content: space-between; gap: 6px;
  padding: 7px 10px; background: #fff; font-size: 12px; }
.video-card .vbar span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; }
.video-card .vbar span .ico { width: 14px; height: 14px; }

@media (max-width: 820px) {
  .sidebar { width: 210px; }
  .ws-main { padding: 16px; }
  .ws-search { width: 150px; }
}

/* ============ 产品问答助手（悬浮客服） ============ */
.cs-fab { position: fixed; right: 22px; bottom: 24px; width: 56px; height: 56px; border-radius: 50%;
  background: var(--c, #1f6feb); color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.22); cursor: pointer; z-index: 60; transition: transform .18s, box-shadow .18s; }
.cs-fab:hover { transform: translateY(-3px); box-shadow: 0 10px 26px rgba(0,0,0,.28); }
.cs-fab.hide { display: none; }
.cs-fab::after { content: ''; position: absolute; top: 1px; right: 2px; width: 10px; height: 10px;
  background: #37b24d; border: 2px solid #fff; border-radius: 50%; }

.cs-panel { position: fixed; right: 22px; bottom: 24px; width: 370px; height: 540px; max-height: calc(100vh - 48px);
  background: #fff; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.2); z-index: 61;
  display: none; flex-direction: column; overflow: hidden; border: 1px solid #e8ecf1; }
.cs-panel.open { display: flex; }
.cs-head { display: flex; align-items: center; gap: 10px; padding: 12px 14px; color: #fff;
  background: var(--c, #1f6feb); flex-shrink: 0; }
.cs-avatar { width: 34px; height: 34px; border-radius: 50%; background: rgba(255,255,255,.22);
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; }
.cs-htxt { display: flex; flex-direction: column; line-height: 1.35; }
.cs-htxt b { font-size: 14px; }
.cs-htxt span { font-size: 11px; opacity: .85; }
.cs-close { margin-left: auto; font-size: 22px; cursor: pointer; opacity: .85; line-height: 1; padding: 0 2px; }
.cs-close:hover { opacity: 1; }
.cs-body { flex: 1; overflow-y: auto; padding: 14px; background: #f7f9fc; }
.cs-msg { max-width: 88%; padding: 9px 12px; border-radius: 10px; font-size: 13px; line-height: 1.65;
  margin-bottom: 10px; word-break: break-word; }
.cs-msg.bot { background: #fff; color: #333; border: 1px solid #eceff3; border-top-left-radius: 2px; }
.cs-msg.user { background: var(--c, #1f6feb); color: #fff; margin-left: auto; border-top-right-radius: 2px; }
.cs-msg b { color: inherit; }
.cs-msg .cs-ptable { width: 100%; border-collapse: collapse; margin: 8px 0 2px; font-size: 12px; }
.cs-msg .cs-ptable td { border: 1px solid #e6e9ee; padding: 4px 7px; }
.cs-msg .cs-ptable td:first-child { background: #f5f7fa; color: #555; width: 40%; }
.cs-link { color: var(--c, #1f6feb); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.cs-login-tip { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #dde3ea; font-size: 12px; color: #888; }
.cs-login-tip a { color: var(--c, #1f6feb); text-decoration: underline; }
.cs-quick { margin: 12px 0 2px; }
.cs-qhint { font-size: 11px; color: #999; margin-bottom: 6px; }
.cs-q { display: inline-block; border: 1px solid #d9e0ea; background: #fff; color: #456;
  border-radius: 14px; padding: 5px 10px; font-size: 12px; margin: 0 6px 6px 0; cursor: pointer; }
.cs-q:hover { border-color: var(--c, #1f6feb); color: var(--c, #1f6feb); }
.cs-inputbar { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #eceff3; background: #fff; flex-shrink: 0; }
.cs-inputbar input { flex: 1; border: 1px solid #dde3ea; border-radius: 18px; padding: 8px 13px;
  font-size: 13px; outline: none; min-width: 0; }
.cs-inputbar input:focus { border-color: var(--c, #1f6feb); }
.cs-inputbar button { border: none; background: var(--c, #1f6feb); color: #fff; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 14px; flex-shrink: 0; }
@media (max-width: 520px) {
  .cs-panel { right: 8px; left: 8px; bottom: 8px; width: auto; height: 76vh; }
  .cs-fab { right: 16px; bottom: 16px; }
}

/* ============ AI 助手配置页 ============ */
.ai-cfg > label { display: block; margin: 14px 0 5px; font-size: 13px; color: #444; }
.ai-cfg .input { width: 100%; }
.ai-note { background: #f5f8fc; border: 1px solid #e4eaf2; border-radius: 8px;
  padding: 10px 12px; font-size: 12px; color: #556; line-height: 1.75; }
.ai-on { display: flex !important; align-items: center; gap: 8px; cursor: pointer; }
.ai-on input { width: 16px; height: 16px; margin: 0; }
.ai-actions { display: flex; align-items: center; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.ai-tip { margin-top: 16px; color: #777; }
.cs-thinking { color: #999; font-style: italic; }
.cs-ai-tag { margin-top: 8px; padding-top: 6px; border-top: 1px dashed #e3e7ec; font-size: 11px; color: #999; }
.cs-related { margin-top: 6px; font-size: 12px; color: #666; }

/* 顶栏登录状态 */
.topbar .user-chip { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: #666; }
.topbar .user-chip .uname { font-weight: 600; color: var(--c); }
.topbar .user-chip a { color: #999; font-size: 12px; }
.topbar .user-chip a:hover { color: var(--c); }
