:root {
  --fm-primary: #409eff;
  --fm-primary-dark: #337ecc;
  --fm-text: #303133;
  --fm-muted: #909399;
  --fm-border: #ebeef5;
  --fm-bg: #f5f7fa;
  --fm-card: #ffffff;
  --fm-danger: #f56c6c;
}

* {
  box-sizing: border-box;
}

body.fm-body {
  margin: 0;
  font-family:
    system-ui,
    -apple-system,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif;
  color: var(--fm-text);
  background: var(--fm-bg);
}

[x-cloak] {
  display: none !important;
}

.fm-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.fm-topbar {
  display: flex;
  align-items: center;
  padding: 0 16px;
  height: 56px;
  background: var(--fm-primary);
  color: #fff;
}

/* 与 .fm-main.fm-page-narrow 同宽居中，使顶栏品牌与正文卡片左缘对齐 */
.fm-topbar.fm-topbar--align-main {
  display: block;
  padding: 0;
}

.fm-topbar__inner {
  display: flex;
  align-items: center;
  max-width: min(1280px, calc(100vw - 96px));
  margin: 0 auto;
  padding: 0 16px;
  min-height: 56px;
}

.fm-brand {
  font-weight: 700;
  cursor: default;
}

.fm-brand a {
  color: inherit;
  text-decoration: none;
}

.fm-topbar .fm-spacer {
  flex: 1;
}

.fm-topbar a.fm-link,
.fm-topbar button.fm-ghost {
  color: #fff;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 4px;
}

.fm-topbar a.fm-link:hover,
.fm-topbar button.fm-ghost:hover {
  background: rgba(255, 255, 255, 0.15);
}

.fm-user {
  margin-right: 8px;
  font-size: 14px;
  opacity: 0.95;
}

.fm-main {
  flex: 1;
  padding: 16px;
}

.fm-admin-wrap {
  display: flex;
  min-height: calc(100vh - 56px);
}

.fm-aside {
  width: 220px;
  border-right: 1px solid var(--fm-border);
  background: var(--fm-card);
  padding: 12px 10px;
}

.fm-aside-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--fm-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px 10px;
}

.fm-aside-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.fm-aside-item {
  display: block;
  position: relative;
  padding: 10px 12px 10px 14px;
  color: var(--fm-text);
  text-decoration: none;
  font-size: 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.fm-aside-item::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.fm-aside-item:hover {
  background: #f5f9ff;
  border-color: #e3eefc;
  color: var(--fm-primary-dark);
  transform: translateX(1px);
}

.fm-aside-item.fm-active {
  background: #ecf5ff;
  border-color: #d9ecff;
  color: var(--fm-primary-dark);
  font-weight: 700;
}

.fm-aside-item.fm-active::before {
  background: var(--fm-primary);
}

.fm-content {
  flex: 1;
  padding: 16px;
  min-width: 0;
}

.fm-card {
  background: var(--fm-card);
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 12px;
}

.fm-hdr {
  display: flex;
  align-items: center;
  margin-bottom: 12px;
  gap: 10px;
}

.fm-hdr .fm-spacer {
  flex: 1;
}

.fm-title {
  font-weight: 800;
  font-size: 16px;
}

.fm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  border-radius: 4px;
  border: 1px solid var(--fm-border);
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}

.fm-btn-primary {
  background: var(--fm-primary);
  border-color: var(--fm-primary);
  color: #fff;
}

.fm-btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.fm-btn-danger {
  color: var(--fm-danger);
  border-color: #fde2e2;
  background: #fef0f0;
}

.fm-btn-danger-outline {
  color: var(--fm-danger);
  border-color: #fde2e2;
  background: #fef0f0;
}

.fm-btn-text {
  border: 0;
  background: transparent;
  color: var(--fm-primary);
  padding: 4px 8px;
}

.fm-btn-sm {
  padding: 5px 10px;
  font-size: 13px;
  line-height: 1.3;
}

.fm-input,
.fm-select,
.fm-textarea {
  width: 100%;
  max-width: 420px;
  padding: 8px 10px;
  border: 1px solid var(--fm-border);
  border-radius: 4px;
  font-size: 14px;
}

.fm-form-row {
  margin-bottom: 12px;
}

.fm-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.fm-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.fm-table th,
.fm-table td {
  border-bottom: 1px solid var(--fm-border);
  padding: 10px 8px;
  text-align: left;
  vertical-align: top;
}

.fm-table th {
  background: #fafafa;
  font-weight: 600;
}

.fm-tag--accent {
  background: #dbeafe;
  border-color: #93c5fd;
  color: #1d4ed8;
}

.fm-tag {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 6px;
  border-radius: 3px;
  border: 1px solid #d9ecff;
  background: #f4f9ff;
  color: #3a7fc5;
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
}

.fm-toast {
  position: fixed;
  right: 16px;
  top: 72px;
  z-index: 9999;
  min-width: 220px;
  max-width: 360px;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.fm-toast.ok {
  background: #67c23a;
}

.fm-toast.err {
  background: #f56c6c;
}

#fm-global-toast {
  position: fixed;
  right: 16px;
  top: 72px;
  z-index: 9999;
  display: none;
}

.fm-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 8000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.fm-modal {
  background: #fff;
  border-radius: 8px;
  max-width: 780px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 16px;
}

.fm-modal h3 {
  margin: 0 0 12px;
}

.fm-print-picker-backdrop {
  z-index: 9000;
}

.fm-print-picker {
  max-width: 420px;
}

.fm-print-picker__hint {
  margin: 0 0 12px;
  font-size: 13px;
  color: var(--fm-muted, #888);
  line-height: 1.5;
}

.fm-print-picker__cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-bottom: 8px;
}

.fm-print-picker__item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
}

.fm-print-picker__item input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.fm-print-picker__quick {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.fm-print-picker__actions {
  justify-content: flex-end;
  gap: 8px;
}

.fm-print-preview-backdrop {
  z-index: 9100;
}

.fm-print-preview {
  width: min(96vw, 920px);
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.fm-print-preview__head {
  flex: 0 0 auto;
  margin-bottom: 10px;
}

.fm-print-preview__head h3 {
  margin: 0 0 6px;
}

.fm-print-preview__hint {
  margin: 0;
  font-size: 13px;
  color: var(--fm-muted, #888);
  line-height: 1.5;
}

.fm-print-preview__paper-wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #ececec;
  border: 1px solid var(--fm-line, #ddd);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
}

.fm-print-preview__paper {
  display: inline-block;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.12);
  padding: 5mm 16px 16px;
  box-sizing: border-box;
  max-width: 100%;
  text-align: center;
  vertical-align: top;
}

.fm-print-preview__paper--landscape {
  width: min(100%, 780px);
  min-height: 420px;
}

.fm-print-preview__paper--portrait {
  width: min(100%, 520px);
  min-height: 640px;
}

.fm-print-preview__paper--portrait.fm-print-sandbox thead tr.fm-print-col-head,
.fm-print-preview__paper--portrait.fm-print-sandbox tbody tr {
  min-height: 15mm;
}

.fm-print-preview__paper--portrait.fm-print-sandbox thead tr.fm-print-doc-title,
.fm-print-preview__paper--portrait.fm-print-sandbox thead tr.fm-print-doc-meta,
.fm-print-preview__paper--portrait.fm-print-sandbox tfoot tr.fm-print-site-foot,
.fm-print-preview__paper--portrait.fm-print-sandbox tfoot tr.fm-print-page-foot {
  min-height: auto;
}

.fm-print-preview__paper--portrait.fm-print-sandbox th,
.fm-print-preview__paper--portrait.fm-print-sandbox td {
  font-size: 13px;
  padding: 1.5mm 1.2mm;
  line-height: 1.4;
}

/* 预览区表格（与打印一致：竖向 A4 短内容约 10-12 行/页，长名称自动换行增高） */
.fm-print-preview__paper.fm-print-sandbox {
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
  color: #111;
  text-align: center;
}

.fm-print-preview__paper.fm-print-sandbox h1 {
  font-size: 17px;
  margin: 0 0 2mm;
  line-height: 1.25;
  text-align: center;
  font-weight: 600;
}

.fm-print-preview__paper.fm-print-sandbox thead tr.fm-print-doc-title td {
  border: none;
  padding: 0 0 2mm;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  background: transparent;
}

.fm-print-preview__paper.fm-print-sandbox thead tr.fm-print-doc-meta td {
  border: none;
  padding: 0 0 3mm;
  background: transparent;
}

.fm-print-preview__paper.fm-print-sandbox tfoot tr.fm-print-site-foot td {
  border: none;
  border-top: 1px solid #bbb;
  padding: 2.5mm 0 1.5mm;
  text-align: left;
  background: transparent;
}

.fm-print-preview__paper.fm-print-sandbox .fm-print-sandbox__footer-text {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  color: #444;
  line-height: 1.45;
}

.fm-print-preview__paper.fm-print-sandbox tfoot tr.fm-print-page-foot td {
  border: none;
  padding: 1.5mm 0 0;
  text-align: center;
  color: #777;
  font-size: 11px;
  background: transparent;
}

.fm-print-preview__paper.fm-print-sandbox tfoot tr.fm-print-site-foot + tr.fm-print-page-foot td {
  border-top: none;
  padding-top: 1mm;
}

.fm-print-preview__paper.fm-print-sandbox tfoot tr.fm-print-page-foot:first-child td {
  border-top: 1px solid #bbb;
  padding-top: 2mm;
}

.fm-print-preview__paper.fm-print-sandbox .fm-print-page-num {
  display: inline-block;
  min-height: 1.2em;
  color: #777;
  font-size: 11px;
  line-height: 1.3;
}

.fm-print-preview__paper.fm-print-sandbox .fm-print-sandbox__info {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  text-align: left;
}

.fm-print-preview__paper--portrait.fm-print-sandbox .sub,
.fm-print-preview__paper.fm-print-sandbox .sub {
  margin: 0;
  color: #555;
  font-size: 11px;
  line-height: 1.2;
  text-align: right;
  flex-shrink: 0;
}

.fm-print-preview__paper--portrait.fm-print-sandbox .meta,
.fm-print-preview__paper.fm-print-sandbox .meta {
  margin: 0;
  color: #777;
  font-size: 11px;
  line-height: 1.2;
  text-align: left;
  flex: 1 1 auto;
  min-width: 0;
}

.fm-print-preview__paper.fm-print-sandbox table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  border: 1px solid #333;
  text-align: left;
}

.fm-print-preview__paper.fm-print-sandbox thead tr.fm-print-col-head,
.fm-print-preview__paper.fm-print-sandbox tbody tr {
  min-height: 6.8mm;
}

.fm-print-preview__paper.fm-print-sandbox thead tr.fm-print-doc-title,
.fm-print-preview__paper.fm-print-sandbox thead tr.fm-print-doc-meta,
.fm-print-preview__paper.fm-print-sandbox tfoot tr.fm-print-site-foot,
.fm-print-preview__paper.fm-print-sandbox tfoot tr.fm-print-page-foot {
  min-height: auto;
}

.fm-print-preview__paper.fm-print-sandbox tbody tr {
  page-break-inside: avoid;
  break-inside: avoid;
}

.fm-print-preview__paper.fm-print-sandbox th,
.fm-print-preview__paper.fm-print-sandbox td {
  border: 1px solid #333;
  padding: 0.8mm 1mm;
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.25;
  font-size: 9px;
  text-align: left;
}

.fm-print-preview__paper.fm-print-sandbox th {
  background: #efefef;
  font-weight: 600;
  text-align: center;
  vertical-align: middle;
}

.fm-print-preview__paper.fm-print-sandbox tr:nth-child(even) td {
  background: #fafafa;
}

.fm-print-preview__paper.fm-print-sandbox tr.fm-print-row--has-cond td {
  background: #e0e0e0;
}

.fm-print-preview__paper.fm-print-sandbox tr.fm-print-row--has-cond:nth-child(even) td {
  background: #d2d2d2;
}

.fm-print-preview__paper.fm-print-sandbox.fm-print-sandbox--watermark {
  position: relative;
}


.fm-print-preview__actions {
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.fm-print-image-save-backdrop {
  z-index: 9200;
}

.fm-print-image-save {
  width: min(96vw, 720px);
  max-width: 96vw;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  padding: 16px;
}

.fm-print-image-save h3 {
  margin: 0 0 8px;
}

.fm-print-image-save__hint {
  margin: 0 0 10px;
  font-size: 13px;
  color: var(--fm-muted, #888);
  line-height: 1.5;
}

.fm-print-image-save__wrap {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: #f5f5f5;
  border: 1px solid var(--fm-line, #ddd);
  border-radius: 8px;
  padding: 8px;
  text-align: center;
}

.fm-print-image-save__page {
  margin: 0 auto 14px;
}

.fm-print-image-save__page:last-child {
  margin-bottom: 0;
}

.fm-print-image-save__page-label {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--fm-muted, #888);
  text-align: center;
}

.fm-print-image-save__page img {
  display: block;
  width: min(100%, 360px);
  height: auto;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  -webkit-touch-callout: default;
  user-select: none;
  aspect-ratio: 210 / 297;
  object-fit: contain;
}

.fm-print-image-save__wrap--landscape .fm-print-image-save__page img {
  aspect-ratio: 297 / 210;
  width: min(100%, 480px);
}

.fm-print-image-save__actions {
  flex: 0 0 auto;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.fm-confirm-modal {
  max-width: 460px;
  border-radius: 14px;
  padding: 22px 20px 18px;
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.22);
}

.fm-confirm-badge {
  width: 38px;
  height: 38px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: #fff3f0;
  border: 1px solid #ffd8cf;
  color: #d1432f;
  font-size: 22px;
  line-height: 34px;
  text-align: center;
  font-weight: 700;
}

.fm-confirm-title {
  text-align: center;
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 700;
}

.fm-confirm-message {
  text-align: center;
  line-height: 1.7;
  font-size: 15px;
  margin-bottom: 16px;
}

.fm-confirm-actions {
  justify-content: center;
  gap: 12px;
}

.fm-confirm-actions .fm-btn {
  min-width: 94px;
}

.fm-muted {
  color: var(--fm-muted);
  font-size: 13px;
}

.fm-row-flex {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.fm-page-narrow {
  max-width: min(1280px, calc(100vw - 96px));
  margin: 0 auto;
}

.fm-search-title {
  text-align: center;
  font-size: 38px;
  font-weight: 700;
  margin: 8px 0 16px;
  color: #262626;
}

.fm-or {
  text-align: center;
  color: #b7b7b7;
  font-size: 13px;
  margin: 10px 0;
}

.fm-img {
  width: 64px;
  height: 64px;
  border: 1px solid var(--fm-border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fm-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fm-name-link {
  font-weight: 700;
  color: var(--fm-primary);
  cursor: pointer;
}

.fm-name-link:hover {
  text-decoration: underline;
}

.fm-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.fm-seg button {
  padding: 6px 12px;
  border: 1px solid var(--fm-border);
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}

.fm-seg button.fm-on {
  border-color: var(--fm-primary);
  color: var(--fm-primary);
  font-weight: 700;
}

.fm-loading {
  opacity: 0.6;
  pointer-events: none;
}

/* 适配绑定：车型 / 年款 / 部位 / 用量 / 单位 同一行（左对齐，部位不撑满整行） */
.fm-fitment-bind-grid {
  display: grid;
  grid-template-columns:
    minmax(5.5rem, 7.5rem)
    minmax(5.5rem, 7.5rem)
    minmax(6rem, 9rem)
    4.25rem
    4.25rem;
  gap: 10px;
  align-items: end;
  width: max-content;
  max-width: 100%;
  box-sizing: border-box;
}

.fm-fitment-bind-grid__narrow,
.fm-fitment-bind-grid__location,
.fm-fitment-bind-grid__qty,
.fm-fitment-bind-grid__unit {
  min-width: 0;
}

.fm-fitment-bind-grid__qty .fm-input,
.fm-fitment-bind-grid__unit .fm-input {
  width: 100%;
  min-width: 0;
  padding-left: 8px;
  padding-right: 8px;
}

.fm-fitment-bind-grid__full {
  grid-column: 1 / -1;
  min-width: 0;
}

@media (max-width: 640px) {
  .fm-fitment-bind-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }
}

/* 适配绑定：适用条件 + 添加（按钮紧跟输入框后，不贴页面右缘） */
.fm-fitment-condition-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  max-width: 720px;
  width: 100%;
}

.fm-fitment-condition-input {
  flex: 1 1 12rem;
  min-width: 10rem;
  max-width: 28rem;
  width: auto;
}

.fm-fitment-condition-add {
  flex-shrink: 0;
  min-width: 5.5rem;
  white-space: nowrap;
}

/* 部位：可输入 + 联想下拉 */
.fm-location-combobox {
  position: relative;
  width: 100%;
}

.fm-location-combobox__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 40;
  max-height: 220px;
  overflow: auto;
  background: #fff;
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.12);
}

.fm-location-combobox__option {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  background: #fff;
  text-align: left;
  font-size: 13px;
  color: var(--fm-text);
  cursor: pointer;
}

.fm-location-combobox__option:hover,
.fm-location-combobox__option.is-active {
  background: #e8f2fa;
}

.fm-location-combobox__option.is-disabled {
  color: var(--fm-muted);
}

.fm-location-combobox__hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--fm-muted);
  line-height: 1.45;
}

@media (max-width: 768px) {
  .fm-search-title {
    font-size: 28px;
  }
}

/* ========== 后台移动端 ========== */
.fm-admin-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0 4px 0 -6px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  cursor: pointer;
}

.fm-admin-menu-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.fm-aside-head {
  display: none;
}

.fm-aside-close {
  display: none;
}

/* 桌面端：仅隐藏手机区块，勿覆盖桌面元素原有 display（flex / table 等） */
.fm-admin-mobile-only {
  display: none !important;
}

/* 配件列表 · 桌面增强 */
.fm-parts-index > .fm-card {
  padding: 12px 14px;
}

.fm-parts-hdr {
  margin-bottom: 8px;
}

.fm-parts-hdr__count {
  font-size: 13px;
}

.fm-parts-hdr__count strong {
  color: var(--fm-text);
  font-weight: 600;
}

.fm-parts-recent {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -2px 0 8px;
  font-size: 12px;
}

.fm-parts-recent__label {
  color: var(--fm-muted);
}

.fm-parts-recent__chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--fm-border);
  background: #fafbfc;
  color: var(--fm-text);
  text-decoration: none;
  max-width: 12rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-parts-recent__chip:hover {
  border-color: #c6e2ff;
  background: #ecf5ff;
  color: var(--fm-primary);
}

.fm-parts-filter {
  margin-bottom: 8px;
}

.fm-parts-filter__main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}

.fm-parts-filter__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
}

.fm-parts-filter__lbl {
  font-size: 12px;
  color: var(--fm-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.fm-parts-filter__ctl {
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 5px 8px;
  font-size: 13px;
}

.fm-parts-filter__item--q .fm-parts-filter__ctl {
  width: 9.5rem;
}

.fm-parts-filter__item:not(.fm-parts-filter__item--q):not(.fm-parts-filter__item--cat) .fm-parts-filter__ctl {
  width: 7.5rem;
}

.fm-parts-filter__item--cat .fm-parts-filter__ctl {
  width: 9rem;
}

.fm-parts-filter__actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.fm-parts-filter__adv-dot {
  color: var(--fm-primary);
  font-weight: 700;
}

.fm-parts-filter__adv {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 6px;
  padding: 6px 10px;
  border-radius: 6px;
  background: #fafbfc;
  border: 1px solid var(--fm-border);
}

.fm-parts-filter__check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--fm-muted);
  cursor: pointer;
  white-space: nowrap;
}

.fm-parts-filter__tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.fm-parts-summary__tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 4px;
  background: #f4f9ff;
  border: 1px solid #d9ecff;
  color: #3a7fc5;
  font-size: 11px;
}

.fm-parts-toolbar-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--fm-border);
}

.fm-parts-toolbar-selected {
  font-size: 12px;
}

.fm-parts-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
}

.fm-parts-toolbar-sep {
  width: 1px;
  height: 18px;
  background: var(--fm-border);
  margin: 0 4px;
}

.fm-parts-pager {
  align-items: center;
}

.fm-parts-pager__opts {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.fm-parts-pager__opt {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  font-size: 12px;
}

.fm-parts-pager__ctl {
  width: auto;
  min-width: 0;
  max-width: none;
  padding: 4px 6px;
  font-size: 12px;
}

.fm-parts-pager__jump {
  width: 3rem;
  max-width: none;
  padding: 4px 6px;
  font-size: 12px;
}

.fm-parts-toolbar-dropdown {
  position: relative;
}

.fm-parts-toolbar-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  z-index: 120;
  min-width: 11rem;
  padding: 6px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--fm-border);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.fm-parts-toolbar-menu .fm-btn {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
}

.fm-parts-table-wrap {
  overflow: auto;
  max-height: min(70vh, 720px);
  margin: 0 -4px;
  border-radius: 8px;
  border: 1px solid var(--fm-border);
}

.fm-parts-table.fm-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #e8f2fa;
  color: #4a6278;
  border-bottom: 1px solid #d4e4f2;
  box-shadow: 0 1px 0 #d4e4f2;
}

.fm-parts-table.fm-table tbody tr.fm-parts-row {
  cursor: pointer;
  transition: background 0.12s ease;
}

.fm-parts-table.fm-table tbody tr.fm-parts-row:hover {
  background: #f8fbff;
}

.fm-parts-table.fm-table tbody tr.fm-parts-row:nth-child(even) {
  background: #fcfdfe;
}

.fm-parts-table.fm-table tbody tr.fm-parts-row:nth-child(even):hover {
  background: #f8fbff;
}

.fm-parts-table .fm-col-name {
  font-weight: 600;
  max-width: 14rem;
}

.fm-parts-table .fm-col-figure {
  font-weight: 500;
  max-width: 10rem;
}

.fm-parts-table .fm-col-ellipsis {
  max-width: 9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-parts-table .fm-fitment-list-cell {
  min-width: 12rem;
  max-width: 22rem;
}

.fm-parts-table .fm-part-thumb {
  width: 56px;
  height: 56px;
  object-fit: contain;
  cursor: zoom-in;
  border-radius: 4px;
  background: #fafafa;
}

.fm-cell-empty {
  color: #c0c4cc;
  font-size: 12px;
  user-select: none;
}

.fm-parts-status-badge {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
}

.fm-parts-status-badge--disabled {
  background: #fef0f0;
  color: #f56c6c;
  border: 1px solid #fde2e2;
}

.fm-parts-dup-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
  color: #b45309;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  vertical-align: middle;
}

.fm-parts-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--fm-muted);
}

.fm-parts-empty__title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fm-text);
  margin: 0 0 8px;
}

.fm-parts-col-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 12px 0;
}

.fm-parts-col-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.fm-image-preview-modal {
  max-width: min(92vw, 640px);
  padding: 0;
  overflow: hidden;
}

.fm-image-preview__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--fm-border);
}

.fm-image-preview__head h3 {
  margin: 0;
  font-size: 16px;
}

.fm-image-preview__body {
  padding: 12px;
  text-align: center;
  background: #f5f7fa;
}

.fm-image-preview__body img {
  max-width: 100%;
  max-height: min(70vh, 520px);
  object-fit: contain;
}

.fm-import-progress {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f0f9eb;
  border: 1px solid #e1f3d8;
  color: #529b2e;
  font-size: 13px;
}

@media (max-width: 768px) {
  .fm-admin-menu-btn {
    display: inline-flex;
  }

  .fm-admin-topuser {
    display: none;
  }

  .fm-admin-toplink {
    font-size: 13px;
    padding: 6px 8px;
  }

  .fm-content {
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .fm-content:has(.fm-parts-index) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .fm-content:has(.fm-part-editor) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .fm-admin-wrap {
    flex-direction: column;
  }

  .fm-aside {
    position: fixed;
    left: 0;
    top: 56px;
    bottom: 0;
    z-index: 210;
    width: min(288px, 88vw);
    border-right: 1px solid var(--fm-border);
    border-bottom: 0;
    padding: 12px 10px;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.12);
    overflow: auto;
  }

  .fm-aside.fm-aside--open {
    transform: translateX(0);
  }

  .fm-aside-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 2px 6px 12px;
    border-bottom: 1px solid var(--fm-border);
    margin-bottom: 8px;
  }

  .fm-aside-head .fm-aside-title {
    padding: 0;
    margin: 0;
  }

  .fm-aside-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 8px;
    background: #f5f7fa;
    color: var(--fm-muted);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }

  .fm-aside-nav {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
  }

  .fm-aside-item {
    width: 100%;
    font-size: 16px;
  }

  .fm-admin-drawer-backdrop {
    position: fixed;
    left: 0;
    right: 0;
    top: 56px;
    bottom: 0;
    z-index: 200;
    background: rgba(15, 23, 42, 0.45);
  }

  .fm-admin-desktop-only {
    display: none !important;
  }

  .fm-admin-mobile-only {
    display: block !important;
  }

  .fm-parts-mtoolbar.fm-admin-mobile-only {
    display: flex !important;
  }

  .fm-parts-cards.fm-admin-mobile-only {
    display: flex !important;
  }

  .fm-parts-selbar.fm-admin-mobile-only {
    display: flex !important;
  }

  .fm-part-savebar.fm-admin-mobile-only {
    display: flex !important;
  }

  .fm-dict-cards.fm-admin-mobile-only {
    display: flex !important;
  }

  .fm-dict-selbar.fm-admin-mobile-only {
    display: flex !important;
  }

  .fm-btn {
    white-space: nowrap;
  }

  .fm-card {
    padding: 12px;
  }

  .fm-hdr .fm-title {
    font-size: 18px;
  }

  /* 配件列表 · 手机工具栏 */
  .fm-parts-mtoolbar {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 4px;
  }

  .fm-parts-mtoolbar__row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
  }

  .fm-parts-mtoolbar__search {
    flex: 1 1 8rem;
    min-width: 0;
    max-width: none !important;
  }

  .fm-parts-mtoolbar__row .fm-btn,
  .fm-parts-mtoolbar__row .fm-btn-primary {
    flex-shrink: 0;
  }

  .fm-parts-mtoolbar__badge {
    font-size: 12px;
    color: var(--fm-primary);
    background: #ecf5ff;
    border: 1px solid #d9ecff;
    border-radius: 999px;
    padding: 2px 8px;
  }

  /* 底部筛选 / 更多面板 */
  .fm-admin-sheet-root {
    position: fixed;
    inset: 0;
    z-index: 350;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
  }

  .fm-admin-sheet-root[style*="display: none"],
  .fm-admin-sheet-root[style*="display:none"] {
    pointer-events: none !important;
  }

  .fm-admin-sheet-backdrop {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: rgba(15, 23, 42, 0.45);
    pointer-events: auto;
  }

  .fm-admin-sheet {
    position: relative;
    z-index: 1;
    flex-shrink: 0;
    width: 100%;
    max-height: min(78vh, 560px);
    overflow: auto;
    background: #fff;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 32px rgba(15, 23, 42, 0.14);
    padding: 12px 16px calc(16px + env(safe-area-inset-bottom, 0px));
    pointer-events: auto;
    -webkit-overflow-scrolling: touch;
  }

  .fm-admin-sheet__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--fm-border);
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
  }

  .fm-admin-sheet__title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
  }

  .fm-admin-sheet__close {
    flex-shrink: 0;
    border: 0;
    background: #f5f7fa;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 8px;
    font-size: 24px;
    line-height: 1;
    color: var(--fm-muted);
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    z-index: 3;
  }

  .fm-admin-sheet__actions {
    display: flex;
    gap: 10px;
    margin-top: 14px;
  }

  .fm-admin-sheet__actions .fm-btn-primary {
    flex: 1;
  }

  .fm-admin-more-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }

  .fm-admin-more-list .fm-btn {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  /* 配件卡片列表 */
  .fm-parts-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .fm-part-card {
    border: 1px solid var(--fm-border);
    border-radius: 10px;
    background: #fff;
    padding: 12px;
  }

  .fm-part-card__head {
    display: flex;
    gap: 10px;
    align-items: flex-start;
  }

  .fm-part-card__check {
    flex-shrink: 0;
    padding-top: 4px;
  }

  .fm-part-card__img {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border: 1px solid var(--fm-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
    font-size: 12px;
    color: var(--fm-muted);
  }

  .fm-part-card__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .fm-part-card__main {
    flex: 1;
    min-width: 0;
  }

  .fm-part-card__name {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
  }

  .fm-part-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 12px;
    font-size: 12px;
    color: var(--fm-muted);
    line-height: 1.5;
  }

  .fm-part-card__meta strong {
    color: var(--fm-text);
    font-weight: 600;
  }

  .fm-part-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 10px;
  }

  .fm-part-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--fm-border);
  }

  .fm-part-card__actions .fm-btn {
    flex: 1;
    justify-content: center;
  }

  .fm-parts-selbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--fm-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .fm-parts-selbar__count {
    font-size: 13px;
    color: var(--fm-muted);
    margin-right: auto;
  }

  .fm-parts-selbar .fm-btn {
    flex-shrink: 0;
  }

  .fm-parts-selbar .fm-btn-danger-outline {
    color: var(--fm-danger);
    border-color: #fde2e2;
    background: #fef0f0;
  }

  /* 编辑页 · 底部保存栏 */
  .fm-part-savebar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: flex;
    gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--fm-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .fm-part-savebar .fm-btn {
    flex: 1;
    justify-content: center;
  }

  .fm-part-savebar .fm-btn-primary {
    flex: 2;
  }

  .fm-part-editor .fm-part-save-inline {
    display: none;
  }

  /* 字典管理 · 手机端 */
  .fm-content:has(.fm-dict-page) {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .fm-content:has(.fm-dict-page.fm-dict-page--selecting) {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
  }

  .fm-dict-hdr {
    display: block !important;
  }

  .fm-dict-hdr .fm-spacer {
    display: none;
  }

  .fm-dict-hdr .fm-title {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .fm-dict-hdr__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .fm-dict-hdr__actions > .fm-btn,
  .fm-dict-hdr__actions > .fm-btn-primary {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 5.5rem;
  }

  .fm-dict-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
  }

  .fm-dict-filter .fm-label {
    margin: 0;
    flex: 0 0 auto;
  }

  .fm-dict-filter .fm-select {
    flex: 1 1 12rem;
    min-width: 0;
    max-width: none !important;
    width: auto;
  }

  .fm-dict-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 0;
    margin-top: 8px;
    border-top: 1px solid var(--fm-border);
    color: var(--fm-muted);
    font-size: 12px;
  }

  .fm-dict-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
  }

  .fm-dict-card {
    border: 1px solid var(--fm-border);
    border-radius: 10px;
    background: #fff;
    padding: 12px;
  }

  .fm-dict-card--lvl-2 {
    margin-left: 12px;
  }

  .fm-dict-card--lvl-3 {
    margin-left: 24px;
  }

  .fm-dict-card__head {
    display: flex;
    align-items: flex-start;
    gap: 10px;
  }

  .fm-dict-card__check {
    flex-shrink: 0;
    padding-top: 2px;
  }

  .fm-dict-card__main {
    flex: 1;
    min-width: 0;
  }

  .fm-dict-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px;
  }

  .fm-dict-card__title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
    flex: 1;
    min-width: 0;
  }

  .fm-dict-card__status {
    flex-shrink: 0;
    margin-top: 1px;
  }

  .fm-dict-card__path {
    margin: 0 0 6px;
    font-size: 12px;
    color: var(--fm-muted);
    line-height: 1.45;
    word-break: break-word;
  }

  .fm-dict-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    font-size: 12px;
    color: var(--fm-muted);
    line-height: 1.5;
  }

  .fm-dict-card__meta strong {
    color: var(--fm-text);
    font-weight: 600;
  }

  .fm-dict-card__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--fm-border);
  }

  .fm-dict-card__actions .fm-btn {
    flex: 1 1 auto;
    justify-content: center;
    min-width: 4.5rem;
  }

  .fm-dict-selbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--fm-border);
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
  }

  .fm-dict-selbar__count {
    font-size: 13px;
    color: var(--fm-muted);
    margin-right: auto;
  }

  .fm-dict-page .fm-modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .fm-dict-page .fm-modal {
    width: 100%;
    max-width: none;
    max-height: min(92vh, 100%);
    border-radius: 16px 16px 0 0;
    padding: 16px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  }

  .fm-dict-page .fm-modal h3 {
    font-size: 17px;
    padding-right: 36px;
  }

  .fm-dict-page .fm-modal .fm-input,
  .fm-dict-page .fm-modal .fm-select {
    max-width: none !important;
    width: 100%;
  }

  .fm-dict-page .fm-modal__actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--fm-border);
    position: sticky;
    bottom: 0;
    background: #fff;
  }

  .fm-dict-page .fm-modal__actions .fm-btn {
    flex: 1;
    justify-content: center;
  }

  .fm-dict-page .fm-modal__actions .fm-btn-primary {
    flex: 2;
  }
}

@media (min-width: 769px) {
  .fm-part-savebar {
    display: none !important;
  }

  .fm-admin-sheet-root {
    display: none !important;
  }

  .fm-dict-page .fm-modal {
    max-width: 560px;
    border-radius: 8px;
    max-height: 90vh;
  }

  .fm-dict-page .fm-modal-backdrop {
    align-items: center;
    padding: 16px;
  }

  .fm-dict-page .fm-modal__actions {
    justify-content: flex-end;
    position: static;
    border-top: 0;
    padding-top: 0;
  }

  .fm-dict-page .fm-modal__actions .fm-btn,
  .fm-dict-page .fm-modal__actions .fm-btn-primary {
    flex: 0 0 auto;
  }
}

/* 导入任务历史 */
.fm-import-history {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--fm-border);
}

.fm-import-history__title {
  font-size: 13px;
  font-weight: 600;
  margin: 0 0 8px;
}

.fm-import-history__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px solid #f0f2f5;
}

.fm-import-history__row:last-child {
  border-bottom: none;
}

.fm-import-history__status {
  font-weight: 500;
  flex: 1 1 100%;
}

.fm-part-editor-steps {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.fm-part-editor-steps__btn {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  background: #fff;
  font-size: 13px;
  cursor: pointer;
}

.fm-part-editor-steps__btn--active {
  border-color: var(--fm-primary);
  color: var(--fm-primary);
  background: #ecf5ff;
}

.wf-quick-models {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.wf-quick-models__label {
  font-size: 12px;
  color: var(--fm-muted, #64748b);
}

.wf-quick-models__chip {
  border: 1px solid #dbeafe;
  background: #f8fbff;
  color: #2563eb;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

.wf-quick-models__chip:hover {
  background: #eff6ff;
}

.wf-quick-models--inline {
  flex: 1 1 100%;
  margin-top: 4px;
}

.wf-desk__fields--keyword {
  flex-wrap: wrap;
  align-items: center;
}

.wf-quick-models--mobile {
  margin-top: 10px;
}
