* { box-sizing: border-box; }
body { font-family: "Microsoft YaHei", sans-serif; margin: 0; background: #f5f6f8; color: #1f2937; }
.view { max-width: 1600px; margin: 0 auto; padding: 20px; }
#login-view { max-width: 360px; margin: 80px auto; text-align: center; }
#login-view input { width: 100%; padding: 10px; margin: 10px 0; border: 1px solid #d1d5db; border-radius: 6px; }
.hidden { display: none !important; }
header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
button { background: #2563eb; color: #fff; border: 0; border-radius: 6px; padding: 8px 14px; cursor: pointer; }
button.ghost { background: transparent; color: #2563eb; border: 1px solid #2563eb; }
button.danger { background: #dc2626; }
.search-row { display: flex; gap: 8px; margin-bottom: 16px; }
.search-row input { flex: 1; padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; }
.result-item { display: flex; align-items: center; gap: 12px; background: #fff; padding: 10px 14px; border-radius: 8px; margin-bottom: 8px; cursor: pointer; }
.result-item .edit-btn, .result-item .del-btn, .result-item .row-check { cursor: pointer; }
.model { font-weight: 700; min-width: 70px; }
.name { flex: 1; }
.src { color: #6b7280; font-size: 12px; }
.sync { font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.sync.success { background: #dcfce7; color: #166534; }
.sync.failed { background: #fee2e2; color: #991b1b; }
.editor-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
/* 产品参数编辑器：左列(参数/功能编辑)更宽，右列(预览/历史)窄 */
.param-editor-grid { grid-template-columns: 2fr 1fr; }
/* 说明书编辑器（3列：内容/关联+图片/历史）等宽，整体更宽 */
.manual-editor-grid { grid-template-columns: 1fr 1fr 1fr; }
/* 专属说明书编辑器：左列(关联+原文+历史)宽，右列(图片)窄 */
.manual-own-grid { grid-template-columns: 2fr 1fr; }
/* 专属说明书原文 textarea 加大 */
#manual-text { min-height: 420px; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; box-sizing: border-box; }
/* 通用说明书原文 textarea 加大 */
#common-text { min-height: 420px; padding: 12px; border: 1px solid #d1d5db; border-radius: 8px; box-sizing: border-box; }
/* 历史区（内容下方） */
#manual-history, #common-history { max-height: 240px; overflow: auto; }
.col { background: #fff; padding: 16px; border-radius: 10px; min-width: 0; }
/* 参数表/输入框：保证内容可读，不挤压 */
/* 参数表：参数名窄列 / 参数值宽列 / 删除按钮固定窄列 */
#param-rows { width: 100%; table-layout: fixed; border-collapse: collapse; }
#param-rows td { padding: 4px 6px 4px 0; vertical-align: middle; }
#param-rows td:nth-child(1) { width: 18px; padding: 4px 2px; }
#param-rows td:nth-child(2) { width: 21%; }
#param-rows td:nth-child(3) { width: 73%; }
#param-rows td:nth-child(4) { width: 4%; text-align: center; }
#param-rows td input { width: 100%; min-width: 0; padding: 10px 12px; font-size: 14px; border: 1px solid #d1d5db; border-radius: 6px; box-sizing: border-box; }
#param-rows td .pk { font-weight: 600; background: #f8fafc; }
#param-rows td .pv { font-size: 14px; }
#param-rows .row-del { width: 30px; height: 30px; padding: 0; font-size: 15px; line-height: 1; background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: 6px; cursor: pointer; }
#param-rows .row-del:hover { background: #fecaca; }
.editor-grid textarea { box-sizing: border-box; }
pre { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 6px; padding: 10px; max-height: 400px; overflow: auto; font-size: 12px; white-space: pre-wrap; }
.history-item { border-bottom: 1px solid #f1f5f9; padding: 6px 0; font-size: 13px; }
.msg { margin-top: 8px; font-size: 14px; }
.msg.ok { color: #16a34a; font-weight: 600; }
.msg.err { color: #dc2626; font-weight: 600; }
.img-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.meta label { display: block; margin: 8px 0; }
.meta input, .meta textarea { width: 100%; padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; }

/* 规整的表单行：标签固定宽度左对齐，输入框占满剩余 */
.field-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.field-row label { width: 72px; flex: 0 0 72px; text-align: right; color: #374151; font-size: 14px; font-weight: 500; }
.field-row input, .field-row textarea { flex: 1; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px; box-sizing: border-box; }
.field-row textarea { min-height: 60px; resize: vertical; }

/* 行内编辑器（型号下方展开） */
.editor-slot { margin: 0 0 12px 0; }
.inline-editor { background: #fff; border: 1px solid #e2e8f0; border-left: 4px solid #2563eb; border-radius: 10px; padding: 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.06); }
.editor-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.editor-head h2 { margin: 0; font-size: 17px; }
.collapse-btn { background: transparent; color: #6b7280; border: 1px solid #d1d5db; }
.editor-slot .editor-grid { margin-top: 4px; }
.result-item + .editor-slot .inline-editor { margin-top: 0; }

/* 关键词编辑区 */
.kw-item { display: flex; gap: 6px; margin-bottom: 6px; }
.kw-item input { flex: 1; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; }
.kw-item button { background: #fee2e2; color: #991b1b; }

/* 草稿提示 */
.draft-hint { font-size: 12px; color: #6b7280; font-weight: normal; }

/* 功能区空提示 */
.fe-empty-tip { font-size: 12px; color: #b45309; margin-top: 4px; }

/* 说明书管理 */
.link-models { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin: 8px 0 16px; }
.link-item { display: flex; align-items: center; gap: 4px; font-size: 13px; padding: 4px 8px; background: #f8fafc; border-radius: 6px; }
#doc-text { padding: 10px; border: 1px solid #d1d5db; border-radius: 6px; box-sizing: border-box; }
#doc-save-btn { margin-top: 12px; }

/* 关联型号：搜索下拉选择 */
.link-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 6px; min-height: 30px; }
.link-tag { display: inline-flex; align-items: center; gap: 6px; background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; border-radius: 6px; padding: 3px 8px; font-size: 13px; }
.link-tag .link-tag-del { background: transparent; border: 0; color: #1d4ed8; cursor: pointer; font-size: 12px; padding: 0 2px; }
.link-tag .link-tag-del:hover { color: #dc2626; }
.link-tags-empty { color: #9ca3af; font-size: 12px; align-self: center; }
.link-search-wrap { position: relative; margin-bottom: 16px; }
.link-search-wrap input { width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; }
.link-suggest { position: absolute; top: 100%; left: 0; right: 0; z-index: 50; background: #fff; border: 1px solid #d1d5db; border-radius: 6px; max-height: 320px; overflow: auto; box-shadow: 0 4px 12px rgba(0,0,0,.08); }
.link-suggest.hidden { display: none !important; }
.link-suggest-count { padding: 6px 10px; font-size: 12px; color: #6b7280; background: #f8fafc; border-bottom: 1px solid #e2e8f0; position: sticky; top: 0; }
.link-suggest-item { display: flex; gap: 8px; padding: 7px 10px; cursor: pointer; font-size: 13px; }
.link-suggest-item:hover { background: #eff6ff; }
.link-suggest-item .ls-model { font-weight: 600; color: #1f2937; }
.link-suggest-item .ls-name { color: #6b7280; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 登录页返回主页链接 */
.back-home { display: block; margin-top: 16px; color: #6b7280; font-size: 13px; text-decoration: none; }
.back-home:hover { color: #2563eb; }

/* 管理界面 header 返回主页 */
.header-actions { display: flex; align-items: center; gap: 12px; }
.back-home-inline { color: #6b7280; font-size: 13px; text-decoration: none; }
.back-home-inline:hover { color: #2563eb; }

/* 批量修改 */
.batch-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 16px; flex-wrap: wrap; }
.batch-check { display: flex; align-items: center; gap: 4px; font-size: 13px; }
.batch-count { font-size: 13px; color: #6b7280; }
.batch-form { display: flex; flex-direction: column; gap: 8px; background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 12px; margin-bottom: 16px; }
.batch-form.hidden { display: none !important; }
.batch-row-item { display: flex; gap: 8px; align-items: center; }
.batch-row-item select { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; max-width: 260px; flex: 1; }
.batch-row-item input { padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 6px; flex: 1; }
.batch-row-item .batch-row-value2 { max-width: 200px; flex: 0 1 200px; }
.batch-row-del { background: #fee2e2; color: #991b1b; border: 1px solid #fecaca; border-radius: 6px; padding: 4px 10px; cursor: pointer; }
.batch-actions { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.batch-actions .msg { margin-top: 0; }
.result-item .row-check { margin-right: 4px; }

/* 管理后台双卡片入口 */
.home-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin: 40px 0; }
.home-card { background: #fff; border: 2px solid #e2e8f0; border-radius: 14px; padding: 28px 24px; cursor: pointer; transition: box-shadow 0.15s, border-color 0.15s; text-align: center; }
.home-card:hover { border-color: #2563eb; box-shadow: 0 6px 20px rgba(37,99,235,0.12); }
.home-card-icon { font-size: 44px; margin-bottom: 12px; }
.home-card-title { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.home-card-desc { font-size: 13px; color: #6b7280; }

/* 视图切换条 */
.view-bar { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.view-title { font-size: 17px; font-weight: 700; }

/* 说明书行内编辑器 */
.manual-slot { margin: 0 0 12px 0; }
.doc-img-item { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.doc-img-item img { border: 1px solid #e5e7eb; }
.doc-img-item .doc-img-caption-input { flex: 1; min-width: 140px; padding: 6px 8px; border: 1px solid #d1d5db; border-radius: 6px; }
.doc-img-caption-save { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; padding: 5px 10px; }
.doc-img-caption-save:disabled { opacity: 0.6; }
.doc-img-caption { flex: 1; font-size: 13px; color: #374151; }
/* 待上传队列 */
#manual-img-queue { margin: 8px 0; padding: 8px; background: #f8fafc; border-radius: 8px; }
.doc-img-item.pending { background: #fff; border: 1px dashed #cbd5e1; border-radius: 6px; padding: 6px 8px; }
.queue-fname { font-size: 13px; color: #374151; min-width: 120px; }
.queue-caption { flex: 1; min-width: 140px; padding: 5px 8px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 13px; }
.queue-remove { background: #fee2e2; color: #991b1b; border: 0; border-radius: 4px; padding: 4px 8px; cursor: pointer; }
#manual-img-file, #manual-img-caption { padding: 8px; border: 1px solid #d1d5db; border-radius: 6px; margin: 4px 0; }
#manual-img-caption { width: 100%; }
#manual-save-btn { margin-top: 12px; }
#manual-img-msg { font-size: 13px; }

/* 说明书双卡片 */
#manuals-home .home-card { text-align: center; }
#common-link-done { margin-top: 6px; }

/* 删除专属说明书确认弹窗 */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: flex; align-items: center; justify-content: center; z-index: 100; }
.modal-overlay.hidden { display: none !important; }
.modal-box { background: #fff; border-radius: 12px; padding: 22px 26px; max-width: 420px; box-shadow: 0 8px 30px rgba(0,0,0,0.2); }
.modal-box h3 { margin: 0 0 10px; font-size: 16px; }
.modal-box p { color: #4b5563; font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- 售后问答卡片（2026-08-31） ---------- */
.faq-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.faq-card:hover {
  border-color: #93c5fd;
  box-shadow: 0 1px 6px rgba(29, 78, 216, .08);
}
.faq-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.faq-card-q {
  font-weight: 600;
  font-size: 14px;
  color: #111827;
  flex: 1;
}
.faq-card-arrow {
  color: #6b7280;
  font-size: 12px;
  white-space: nowrap;
}
.faq-card-body {
  border-top: 1px dashed #e5e7eb;
  margin-top: 10px;
  padding-top: 10px;
}
.faq-card-answer {
  color: #374151;
  font-size: 13.5px;
  line-height: 1.7;
  white-space: pre-wrap;
  margin: 0 0 8px;
}
.faq-card-tags {
  color: #6b7280;
  font-size: 12px;
  margin-bottom: 8px;
}
.faq-card-ops {
  display: flex;
  gap: 8px;
}
.faq-card-ops button { font-size: 13px; }
.faq-card.sync-failed { border-color: #fca5a5; background: #fffafa; }

/* FAQ 关联型号下拉：与短输入框同宽（2026-08-31） */
#faq-model-suggest { left: 0; right: auto; width: 260px; }

/* 参数排序（2026-09-02） */
.row-drag { cursor: grab; color: #9ca3af; user-select: none; text-align: center; width: 18px; }
tr.param-row-dragging { opacity: .35; }
tr.param-drop-over td { border-top: 2px solid #93c5fd !important; }

/* 全局参数排序弹窗：卡片化（2026-09-02） */
#param-order-list { background: #f9fafb; }
#param-order-list .modal-item {
  display: flex; align-items: center; gap: 10px;
  background: #fff; border: 1px solid #e5e7eb; border-radius: 8px;
  padding: 8px 12px; margin-bottom: 8px; cursor: grab;
  box-shadow: 0 1px 2px rgba(0,0,0,.04);
}
#param-order-list .modal-item:hover { border-color: #93c5fd; background: #f8fbff; }
#param-order-list .modal-item.dragging { opacity: .35; }
#param-order-list .modal-drag { color: #9ca3af; cursor: grab; user-select: none; }
#param-order-list .modal-idx { width: 22px; text-align: center; color: #9ca3af; font-size: 12px; }
#param-order-list .modal-key { font-weight: 600; font-size: 13px; color: #111827; }
#param-order-list .modal-key { flex: 1; }
#param-order-list .modal-del { background: #fff; color: #dc2626; border: 1px solid #fecaca; border-radius: 6px; width: 22px; height: 22px; line-height: 1; cursor: pointer; font-size: 12px; padding: 0; flex: none; }
#param-order-list .modal-del:hover { background: #fef2f2; }
