: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: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  padding: 0 16px;
  height: 56px;
  background: var(--fm-primary);
  color: #fff;
}

.fm-topbar__left,
.fm-topbar__right {
  display: flex;
  align-items: center;
  min-width: 0;
}

.fm-topbar__left {
  justify-self: start;
  gap: 4px;
}

.fm-topbar__right {
  justify-self: end;
  justify-content: flex-end;
  gap: 4px;
}

/* 与 .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-admin-wrap--no-aside .fm-content {
  width: 100%;
}

@media (min-width: 769px) {
  .fm-aside.fm-aside--no-desktop {
    display: none;
  }
}

.fm-topbar__module {
  font-size: 16px;
  font-weight: 600;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-aside {
  width: 220px;
  flex-shrink: 0;
  align-self: flex-start;
  position: sticky;
  top: 0;
  max-height: calc(100vh - 56px);
  border-right: 1px solid var(--fm-border);
  background: var(--fm-card);
  padding: 12px 10px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}

.fm-aside.fm-aside--scroll-active {
  scrollbar-color: rgba(144, 147, 153, 0.28) transparent;
}

.fm-aside::-webkit-scrollbar {
  width: 5px;
}

.fm-aside::-webkit-scrollbar-track {
  background: transparent;
}

.fm-aside::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 999px;
  transition: background 0.3s ease;
}

.fm-aside.fm-aside--scroll-active::-webkit-scrollbar-thumb {
  background: rgba(144, 147, 153, 0.28);
}

.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: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  padding: 9px 12px 9px 14px;
  color: var(--fm-text);
  text-decoration: none;
  font-size: 15px;
  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-icon {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: #a8abb2;
  transition: color 0.2s ease;
}

.fm-aside-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.fm-aside-item__label {
  flex: 1;
  min-width: 0;
  line-height: 1.35;
}

.fm-aside-item:hover .fm-aside-icon,
.fm-aside-item.fm-active .fm-aside-icon {
  color: var(--fm-primary);
}

.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-topnav {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 2px;
  justify-self: center;
  min-width: 0;
  max-width: 100%;
  height: 56px;
  overflow-x: auto;
  scrollbar-width: none;
}

.fm-topnav::-webkit-scrollbar {
  display: none;
}

.fm-topnav-item {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: rgba(255, 255, 255, 0.78);
  text-decoration: none;
  padding: 0 20px;
  border-radius: 0;
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.fm-topnav-item::after {
  content: '';
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: transparent;
  transition: background-color 0.2s ease, transform 0.2s ease;
  transform: scaleX(0.6);
}

.fm-topnav-item:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
}

.fm-topnav-item:hover::after {
  background: rgba(255, 255, 255, 0.45);
  transform: scaleX(1);
}

.fm-topnav-item.is-active {
  color: #fff;
  font-weight: 600;
  background: transparent;
}

.fm-topnav-item.is-active::after {
  background: #fff;
  transform: scaleX(1);
  box-shadow: 0 -1px 6px rgba(255, 255, 255, 0.25);
}

.fm-topnav-item--cta {
  align-self: center;
  height: 34px;
  margin: 0 2px;
  padding: 0 16px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

.fm-topnav-item--cta::after {
  display: none;
}

.fm-topnav-item--cta:hover {
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.fm-admin-billing-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 8px;
  background: #fff;
  color: var(--fm-primary);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.fm-admin-billing-cta:hover {
  background: #f0f7ff;
  color: var(--fm-primary-dark);
}

.fm-aside-item--cta {
  background: #f0f7ff;
  border-color: #d9ecff;
  font-weight: 600;
}

.fm-aside-group + .fm-aside-group {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--fm-border);
}

.fm-aside-group-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--fm-muted);
  letter-spacing: 0.04em;
  padding: 4px 12px 6px;
}

.fm-aside-item--sub {
  padding-left: 20px;
  font-size: 14px;
}

.fm-aside-item--sub .fm-aside-icon {
  width: 15px;
  height: 15px;
}

.fm-aside-item--sub .fm-aside-icon svg {
  width: 15px;
  height: 15px;
}

.fm-aside-item--sub::before {
  left: 12px;
}

.fm-aside-item--disabled {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px 9px 14px;
  color: var(--fm-muted);
  font-size: 14px;
  opacity: 0.7;
  cursor: not-allowed;
}

.fm-aside-item--disabled .fm-aside-icon {
  color: #c0c4cc;
}

.fm-aside-item--placeholder {
  color: #606266;
}

.fm-placeholder-page {
  max-width: 560px;
  margin: 24px auto;
  text-align: center;
  padding: 40px 24px;
}

.fm-placeholder-page__icon {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 12px;
}

.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-modal--batch-bind {
  max-width: 480px;
  overflow: visible;
}

.fm-batch-bind-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fm-batch-bind-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: start;
}

.fm-batch-bind-form__row--compact {
  grid-template-columns: 7rem 7rem;
}

.fm-batch-bind-form .fm-select,
.fm-batch-bind-form .fm-input {
  width: 100%;
  max-width: none;
  box-sizing: border-box;
}

.fm-batch-bind-form .fm-form-row {
  margin-bottom: 0;
}

.fm-year-picker {
  position: relative;
  width: 100%;
}

.fm-year-picker__trigger {
  width: 100%;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.fm-year-picker__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--fm-border);
  margin-bottom: 6px;
}

.fm-year-picker__option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  cursor: pointer;
}

@media (max-width: 480px) {
  .fm-batch-bind-form__row,
  .fm-batch-bind-form__row--compact {
    grid-template-columns: 1fr;
  }
}

/* 适配绑定：适用条件 + 添加（按钮紧跟输入框后，不贴页面右缘） */
.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;
}

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

.fm-model-combobox__input {
  width: 100%;
  padding-right: 28px;
}

.fm-model-combobox__arrow {
  position: absolute;
  right: 10px;
  bottom: 50%;
  transform: translateY(50%);
  color: var(--fm-muted);
  pointer-events: none;
  font-size: 12px;
  line-height: 1;
}

.fm-model-combobox__panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 45;
  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-model-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-model-combobox__option:hover,
.fm-model-combobox__option.is-selected {
  background: #e8f2fa;
}

.fm-model-combobox__option.is-disabled {
  color: var(--fm-muted);
  cursor: not-allowed;
}

.fm-model-combobox__empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--fm-muted);
}

/* 替代关系：关联配件搜索下拉 */
.fm-relation-combobox {
  position: relative;
  width: 100%;
}

.fm-relation-combobox__panel {
  margin-top: 6px;
  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.08);
}

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

.fm-relation-combobox__option:last-child {
  border-bottom: 0;
}

.fm-relation-combobox__option:hover {
  background: #e8f2fa;
}

.fm-relation-combobox__hint,
.fm-relation-combobox__empty {
  margin: 0;
  padding: 10px 12px;
  font-size: 12px;
  color: var(--fm-muted);
}

@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-bin {
  font-weight: 600;
  max-width: 7rem;
  vertical-align: middle;
}

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

.fm-parts-table .fm-col-code-figure {
  max-width: 10rem;
  line-height: 1.4;
  vertical-align: middle;
}

.fm-col-code-figure__line {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.fm-col-code-figure__line + .fm-col-code-figure__line {
  margin-top: 2px;
}

.fm-col-code-figure__label {
  color: #909399;
  margin-right: 4px;
}

.fm-col-code-figure__value {
  font-weight: 500;
}

.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-parts-actions-cell {
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}

.fm-parts-row-actions {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.fm-parts-action-link {
  border: 0;
  background: transparent;
  color: var(--fm-primary);
  padding: 2px 4px;
  font-size: 12px;
  line-height: 1.3;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

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

.fm-parts-row-actions-dropdown {
  position: relative;
  display: inline-flex;
}

.fm-parts-action-more {
  border: 0;
  background: transparent;
  color: #606266;
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 4px;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
}

.fm-parts-action-more:hover {
  background: #f0f2f5;
  color: var(--fm-primary);
}

.fm-parts-row-actions-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 2px);
  z-index: 30;
  min-width: 5.5rem;
  padding: 4px 0;
  border-radius: 6px;
  background: #fff;
  border: 1px solid var(--fm-border);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.1);
}

.fm-parts-row-actions-menu__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 6px 12px;
  border: 0;
  background: transparent;
  font-size: 12px;
  color: var(--fm-primary);
  cursor: pointer;
  text-decoration: none;
}

.fm-parts-row-actions-menu__item:hover {
  background: #f5f7fa;
}

.fm-parts-row-actions-menu__item--danger {
  color: var(--fm-danger);
}

.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-topbar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
  }

  .fm-topbar__left {
    flex: 1;
    min-width: 0;
    gap: 8px;
  }

  .fm-topnav {
    display: none;
  }

  .fm-topbar__right {
    display: none;
  }

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

  .fm-aside-mobile-modules .fm-aside-group {
    margin-bottom: 4px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--fm-border);
  }

  .fm-aside-mobile-foot {
    flex-shrink: 0;
    margin-top: auto;
    padding: 12px 10px calc(12px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--fm-border);
    background: #fafbfc;
  }

  .fm-aside-mobile-foot__billing {
    display: block;
    margin-bottom: 8px;
    padding: 12px 10px;
    border-radius: 10px;
    background: var(--fm-primary);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
    text-align: center;
  }

  .fm-aside-mobile-foot__link {
    display: block;
    padding: 10px 8px;
    color: var(--fm-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
  }

  .fm-aside-mobile-foot__user {
    padding: 8px 8px 4px;
    font-size: 12px;
    color: var(--fm-muted);
    word-break: break-all;
  }

  .fm-aside-mobile-foot__logout {
    display: block;
    width: 100%;
    margin-top: 4px;
    padding: 10px 8px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #606266;
    font-size: 14px;
    text-align: left;
    cursor: pointer;
  }

  .fm-aside-mobile-foot__logout:hover {
    background: #f0f2f5;
  }

  .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(96px + 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: 0;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 8px 0 28px rgba(15, 23, 42, 0.12);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .fm-aside-nav {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 12px 10px;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
  }

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

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

  .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-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-part-editor-steps.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: 10px 12px;
    cursor: pointer;
  }

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

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

  .fm-part-card__img {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border: 1px solid var(--fm-border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #fafafa;
    font-size: 11px;
    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__title-row {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-bottom: 4px;
  }

  .fm-part-card__name {
    margin: 0;
    flex: 1;
    min-width: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.35;
    word-break: break-word;
  }

  .fm-part-card__actions {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-top: 1px;
  }

  .fm-part-card__code-figure {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 4px;
  }

  .fm-part-card__code-figure-line {
    font-size: 12px;
    color: var(--fm-muted);
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .fm-part-card__meta {
    font-size: 12px;
    color: var(--fm-muted);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

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

  .fm-part-card__tags {
    display: none;
  }

  .fm-part-card__actions .fm-btn {
    flex: none;
  }

  .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 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    z-index: 130 !important;
    display: flex !important;
    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-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;
}

@media (max-width: 768px) {
  .fm-part-editor-steps {
    position: static;
    background: transparent;
    padding: 0 0 10px;
    margin-bottom: 10px;
    box-shadow: none;
  }

  #fm-part-fitment,
  #fm-part-draft-fitment {
    scroll-margin-top: calc(56px + 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;
}

/* 配件编辑页：桌面双栏 + 紧凑表单网格 */
.fm-part-editor__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}

.fm-part-editor__main {
  min-width: 0;
}

.fm-part-editor__aside {
  position: sticky;
  top: 72px;
}

.fm-part-editor__hdr {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.fm-part-editor .fm-card .fm-input,
.fm-part-editor .fm-card .fm-select,
.fm-part-editor .fm-card .fm-textarea {
  max-width: none;
  width: 100%;
}

.fm-part-editor__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}

.fm-part-editor__span-2 {
  grid-column: 1 / -1;
}

.fm-part-editor__meta {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px 12px;
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  background: #fafbfc;
}

.fm-part-editor__meta .fm-form-row {
  margin-bottom: 0;
}

.fm-part-editor__meta-hint {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 12px;
  color: var(--fm-muted);
}

.fm-part-editor__split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 14px;
  align-items: start;
}

.fm-part-editor__spec-remark {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
}

.fm-part-editor__spec-remark .fm-form-row,
.fm-part-editor__images .fm-form-row {
  margin-bottom: 0;
}

.fm-part-editor__remark {
  min-height: 72px;
  resize: vertical;
}

.fm-part-editor__images {
  margin-top: 14px;
}

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

.fm-part-editor__image-item {
  position: relative;
  width: 88px;
}

.fm-part-editor__image-thumb {
  width: 88px;
  height: 88px;
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.fm-part-editor__image-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--fm-border);
  border-radius: 50%;
  background: #fff;
  color: var(--fm-danger);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.fm-part-editor__image-add {
  position: relative;
  width: 88px;
  height: 88px;
  border: 1px dashed var(--fm-border);
  border-radius: 8px;
  background: #fafbfc;
  color: var(--fm-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.fm-part-editor__image-add:hover {
  border-color: var(--fm-primary, #2563eb);
  background: #f0f6ff;
  color: var(--fm-primary, #2563eb);
}

.fm-part-editor__image-input {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  overflow: hidden;
}

.fm-part-editor__image-add-icon {
  font-size: 22px;
  line-height: 1;
  font-weight: 300;
}

.fm-part-editor__image-add-text {
  font-size: 12px;
}

.fm-part-editor__image-hint {
  margin: 6px 0 0;
  font-size: 12px;
}

.fm-part-editor__split .fm-form-row {
  margin-bottom: 0;
}

.fm-part-editor__section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--fm-border);
}

.fm-part-editor__section .fm-fitment-bind-grid {
  width: 100%;
  max-width: none;
  grid-template-columns:
    minmax(7rem, 1fr)
    minmax(7rem, 1fr)
    minmax(8rem, 1.2fr)
    4.5rem
    4.5rem;
}

.fm-part-editor__fit-list,
.fm-part-editor__fit-toolbar {
  max-width: none;
  width: 100%;
}

.fm-part-editor__preview-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: min(60vh, 520px);
  overflow: auto;
}

.fm-part-editor__preview-empty {
  font-size: 12px;
  color: var(--fm-muted);
}

.fm-part-editor__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--fm-border);
}

@media (max-width: 1100px) {
  .fm-part-editor__layout {
    grid-template-columns: 1fr;
  }

  .fm-part-editor__aside {
    position: static;
    order: -1;
  }

  .fm-part-editor__meta {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .fm-part-editor {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }

  .fm-part-editor .fm-card {
    padding: 10px;
    overflow-x: hidden;
  }

  .fm-part-editor__hdr {
    margin-bottom: 4px;
  }

  .fm-part-editor__hdr .fm-title {
    font-size: 16px;
  }

  .fm-part-editor .fm-form-row {
    margin-bottom: 8px;
  }

  .fm-part-editor .fm-label {
    font-size: 12px;
    margin-bottom: 3px;
  }

  .fm-part-editor .fm-input,
  .fm-part-editor .fm-select,
  .fm-part-editor textarea.fm-input {
    padding: 7px 9px;
    font-size: 14px;
  }

  .fm-part-editor__grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px 10px;
  }

  .fm-part-editor__span-2 {
    grid-column: 1 / -1;
  }

  .fm-part-editor__meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding: 10px;
    margin: 8px 0;
  }

  .fm-part-editor__meta-hint {
    grid-column: 1 / -1;
    font-size: 11px;
    line-height: 1.4;
  }

  .fm-part-editor__spec-remark {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 8px;
  }

  .fm-part-editor__remark {
    min-height: 52px;
  }

  .fm-part-editor__images {
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .fm-part-editor__image-hint {
    display: none;
  }

  .fm-part-editor__image-item,
  .fm-part-editor__image-add {
    width: 72px;
  }

  .fm-part-editor__image-thumb {
    width: 72px;
    height: 72px;
  }

  .fm-part-editor__section {
    margin-top: 10px;
    padding-top: 10px;
  }

  .fm-part-editor__section > .fm-title {
    font-size: 13px !important;
    margin-bottom: 8px !important;
  }

  .fm-part-relations__title {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .fm-part-relations__hint {
    font-size: 11px;
    margin-bottom: 8px;
    line-height: 1.45;
  }

  .fm-part-editor__name-hint {
    display: none;
  }

  .fm-part-editor__preview-card {
    padding: 8px 10px;
  }

  .fm-part-editor__preview-card .fm-title {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .fm-part-editor__section .fm-fitment-bind-grid {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  .fm-part-editor__section .fm-fitment-bind-grid__narrow,
  .fm-part-editor__section .fm-fitment-bind-grid__location,
  .fm-part-editor__section .fm-fitment-bind-grid__full {
    grid-column: 1 / -1;
  }

  .fm-part-editor__section .fm-fitment-condition-row {
    max-width: none;
  }

  .fm-part-editor__section .fm-fitment-condition-input {
    min-width: 0;
    max-width: none;
    flex: 1 1 auto;
  }
}

/* Admin home dashboard */
.fm-dashboard {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 16px;
  align-items: start;
}

.fm-dashboard__main,
.fm-dashboard__side {
  margin-bottom: 0;
}

.fm-dashboard-overview__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.fm-dashboard-overview__title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm-dashboard-overview__title {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.fm-dashboard-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid #c0c4cc;
  color: #909399;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  cursor: help;
}

.fm-dashboard-overview__range {
  margin: 6px 0 0;
  font-size: 13px;
}

.fm-dashboard-date {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fm-dashboard-date__input {
  width: 140px;
  height: 34px;
  font-size: 13px;
}

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

.fm-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.fm-dashboard-metric {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 88px;
  padding: 16px;
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  background: #fff;
}

.fm-dashboard-metric--primary {
  background: linear-gradient(135deg, #409eff 0%, #53a8ff 100%);
  border-color: #409eff;
  color: #fff;
}

.fm-dashboard-metric__icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(64, 158, 255, 0.12);
  color: #409eff;
  flex-shrink: 0;
}

.fm-dashboard-metric--primary .fm-dashboard-metric__icon {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.fm-dashboard-metric__icon svg {
  width: 22px;
  height: 22px;
}

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

.fm-dashboard-metric--primary .fm-dashboard-metric__label {
  color: rgba(255, 255, 255, 0.88);
}

.fm-dashboard-metric__value {
  margin-top: 6px;
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
}

.fm-dashboard-chart {
  position: relative;
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  background: #fff;
  padding: 8px 8px 0;
  min-height: 280px;
}

.fm-dashboard-chart__svg {
  width: 100%;
  height: 280px;
  display: block;
}

.fm-dashboard-chart__grid line {
  stroke: #eef2f7;
  stroke-width: 1;
}

.fm-dashboard-chart__grid text,
.fm-dashboard-chart__svg > text {
  fill: #909399;
  font-size: 12px;
}

.fm-dashboard-chart__line {
  fill: none;
  stroke: #409eff;
  stroke-width: 2;
}

.fm-dashboard-chart__dot {
  fill: #409eff;
  stroke: #fff;
  stroke-width: 2;
  cursor: pointer;
}

.fm-dashboard-chart__dot--active {
  r: 5;
}

.fm-dashboard-chart__tooltip {
  position: absolute;
  top: 18px;
  transform: translateX(-50%);
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(48, 49, 51, 0.92);
  color: #fff;
  font-size: 12px;
  line-height: 1.5;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

.fm-dashboard-chart__tooltip strong {
  display: block;
  font-weight: 600;
}

.fm-dashboard-todos__title {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
}

.fm-dashboard-todos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.fm-dashboard-todo {
  min-height: 92px;
  padding: 16px 12px;
  border: 1px solid var(--fm-border);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.fm-dashboard-todo--wide {
  grid-column: 1 / -1;
}

.fm-dashboard-todo--link {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.fm-dashboard-todo--link:hover {
  border-color: #b3d8ff;
  box-shadow: 0 4px 14px rgba(64, 158, 255, 0.08);
}

.fm-dashboard-todo__value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.1;
  color: #303133;
}

.fm-dashboard-todo__label {
  margin-top: 8px;
  font-size: 13px;
  color: var(--fm-muted);
}

@media (max-width: 1100px) {
  .fm-dashboard {
    grid-template-columns: 1fr;
  }

  .fm-dashboard-overview__head {
    flex-direction: column;
  }

  .fm-dashboard-date {
    width: 100%;
    flex-wrap: wrap;
  }
}

@media (max-width: 720px) {
  .fm-dashboard-metrics {
    grid-template-columns: 1fr;
  }
}

.fm-dashboard-metrics--wide {
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.fm-orders-stats-note {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.5;
}

.fm-orders-sales__head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.fm-orders-sales__sub {
  margin: 4px 0 0;
  font-size: 13px;
}

.fm-orders-sales__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--fm-border);
  margin-bottom: 14px;
}

.fm-orders-sales__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 132px;
}

.fm-orders-sales__field--grow {
  flex: 1 1 200px;
  min-width: 180px;
}

.fm-orders-sales__label {
  font-size: 12px;
  color: var(--fm-muted);
}

.fm-orders-sales__sep {
  align-self: flex-end;
  padding-bottom: 8px;
  color: var(--fm-muted);
  font-size: 13px;
}

.fm-orders-sales__actions {
  display: flex;
  gap: 8px;
  align-self: flex-end;
}

.fm-orders-sales__table-wrap {
  overflow: auto;
}

.fm-orders-sales__table {
  min-width: 960px;
}

.fm-orders-sales__empty {
  text-align: center;
  color: var(--fm-muted);
  padding: 32px 12px !important;
}

.fm-orders-sales__pager {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
}

/* 订单页按钮体系 */
.fm-orders-sales .fm-os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease, transform 0.05s ease;
  white-space: nowrap;
}

.fm-orders-sales .fm-os-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.fm-orders-sales .fm-os-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.fm-orders-sales .fm-os-btn--primary {
  background: linear-gradient(180deg, #4dabff 0%, var(--fm-primary) 100%);
  border-color: #3a96eb;
  color: #fff;
  box-shadow: 0 1px 2px rgba(64, 158, 255, 0.28);
}

.fm-orders-sales .fm-os-btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #66b8ff 0%, #3a96eb 100%);
  box-shadow: 0 2px 6px rgba(64, 158, 255, 0.32);
}

.fm-orders-sales .fm-os-btn--secondary {
  background: #fff;
  border-color: #dbe3ee;
  color: #64748b;
}

.fm-orders-sales .fm-os-btn--secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.fm-orders-sales .fm-os-btn--ghost {
  background: #fff;
  border-color: #e2e8f0;
  color: #64748b;
}

.fm-orders-sales .fm-os-btn--ghost:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: var(--fm-primary);
}

.fm-orders-sales .fm-os-btn--pager {
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  background: #fff;
  border-color: #e2e8f0;
  color: #475569;
  font-size: 12px;
}

.fm-orders-sales .fm-os-btn--pager:hover:not(:disabled) {
  border-color: #bfdbfe;
  color: var(--fm-primary);
  background: #f0f9ff;
}

.fm-orders-sales .fm-os-btn__icon {
  font-size: 14px;
  line-height: 1;
}

.fm-orders-sales .fm-os-filter-actions {
  display: flex;
  gap: 8px;
  align-self: flex-end;
}

.fm-orders-sales .fm-os-pager__info {
  font-size: 13px;
  color: var(--fm-muted);
  min-width: 88px;
  text-align: center;
}

.fm-orders-sales__ops {
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}

.fm-orders-sales .fm-os-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.fm-orders-sales .fm-os-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fm-orders-sales .fm-os-action--view {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #2563eb;
}

.fm-orders-sales .fm-os-action--view:hover {
  background: #dbeafe;
  border-color: #93c5fd;
  box-shadow: 0 1px 3px rgba(37, 99, 235, 0.12);
}

.fm-orders-sales .fm-os-action--print {
  background: #f8fafc;
  border-color: #e2e8f0;
  color: #475569;
}

.fm-orders-sales .fm-os-action--print:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #334155;
}

.fm-orders-sales .fm-os-action--settle {
  background: #fffbeb;
  border-color: #fde68a;
  color: #b45309;
}

.fm-orders-sales .fm-os-action--settle:hover {
  background: #fef3c7;
  border-color: #fcd34d;
  color: #92400e;
}

.fm-orders-sales .fm-os-action--danger {
  background: #fef2f2;
  border-color: #fecaca;
  color: #dc2626;
}

.fm-orders-sales .fm-os-action--danger:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.fm-customers__head {
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
}

.fm-customers__head .fm-os-btn {
  flex-shrink: 0;
}

.fm-customers__sub {
  margin: 4px 0 0;
  font-size: 13px;
}

.fm-customers__stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.fm-customers-stat {
  padding: 12px 14px;
  border: 1px solid var(--fm-border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.fm-customers-stat--accent {
  background: linear-gradient(180deg, #fff7ed 0%, #fff 100%);
  border-color: #fed7aa;
}

.fm-customers-stat__label {
  display: block;
  font-size: 12px;
  color: var(--fm-muted);
  margin-bottom: 6px;
}

.fm-customers-stat__value {
  display: block;
  font-size: 22px;
  line-height: 1.2;
  color: #0f172a;
  font-weight: 700;
}

.fm-customers-stat__value.is-warn {
  color: #b45309;
}

.fm-customers-stat__value.is-debt {
  color: #dc2626;
  font-size: 20px;
}

.fm-customers__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 10px 12px;
  padding: 0 0 14px;
  border-bottom: 1px solid var(--fm-border);
  margin-bottom: 14px;
}

.fm-customers__field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 132px;
}

.fm-customers__field--grow {
  flex: 1 1 240px;
  min-width: 200px;
}

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

.fm-customers__actions {
  align-self: flex-end;
}

.fm-customers__table-wrap {
  overflow: auto;
}

.fm-customers__table {
  min-width: 920px;
}

.fm-customers__col-avatar {
  width: 52px;
}

.fm-customers__col-num {
  text-align: right;
  white-space: nowrap;
}

.fm-customers-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  color: #2563eb;
  font-size: 14px;
  font-weight: 700;
  border: 1px solid #bfdbfe;
}

.fm-customers__name {
  display: block;
  color: #0f172a;
}

.fm-customers__remark {
  display: block;
  font-size: 11px;
  margin-top: 2px;
}

.fm-customers__address {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm-customers__time {
  white-space: nowrap;
  font-size: 12px;
  color: #64748b;
}

.fm-customers__empty {
  text-align: center;
  color: var(--fm-muted);
  padding: 32px 12px !important;
}

.fm-customers__ops {
  vertical-align: middle;
  white-space: nowrap;
  width: 1%;
}

.fm-customers__pager {
  padding-top: 14px;
}

/* 后台复用 billing 弹窗：提高层级并确保实底 */
.fm-customers .billing-modal-backdrop,
.fm-orders-sales .billing-modal-backdrop {
  z-index: 9300;
}

.fm-customers .billing-card.billing-modal,
.fm-orders-sales .billing-card.billing-modal {
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.16);
  max-height: min(90vh, 720px);
  overflow: auto;
}

.fm-customers .billing-btn,
.fm-orders-sales .billing-btn {
  background: #fff;
  border-color: #dbe3ee;
  color: #334155;
}

.fm-customers .billing-btn-primary,
.fm-orders-sales .billing-btn-primary {
  background: var(--fm-primary);
  border-color: var(--fm-primary);
  color: #fff;
}

.fm-customers .billing-meta-grid input,
.fm-customers .billing-meta-grid select,
.fm-orders-sales .billing-meta-grid input,
.fm-orders-sales .billing-meta-grid select {
  background: #fff;
  border: 1px solid var(--fm-border);
}

@media (max-width: 900px) {
  .fm-customers__stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .fm-customers__stats {
    grid-template-columns: 1fr;
  }
}

/* 会员消费分析 — 参考零售后台布局 */
.fm-member-consumption .fm-mc-panel {
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 4px;
  overflow: hidden;
}

.fm-member-consumption .fm-mc-search {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #ebeef5;
}

.fm-member-consumption .fm-mc-search__input {
  flex: 1;
  min-width: 180px;
  max-width: 280px;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  background: #fff;
  outline: none;
  transition: border-color 0.15s;
}

.fm-member-consumption .fm-mc-search__input:focus {
  border-color: var(--fm-primary);
}

.fm-member-consumption .fm-mc-search__select {
  min-width: 160px;
  height: 36px;
  padding: 0 28px 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23909399' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
  outline: none;
}

.fm-member-consumption .fm-mc-search__select:focus {
  border-color: var(--fm-primary);
}

.fm-member-consumption .fm-mc-search__submit {
  min-width: 72px;
  height: 36px;
  border-radius: 4px;
}

.fm-member-consumption .fm-mc-refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: none;
  background: none;
  color: #606266;
  font-size: 14px;
  cursor: pointer;
  transition: color 0.15s;
}

.fm-member-consumption .fm-mc-refresh:hover:not(:disabled) {
  color: var(--fm-primary);
}

.fm-member-consumption .fm-mc-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.fm-member-consumption .fm-mc-refresh__icon {
  font-size: 16px;
  line-height: 1;
}

.fm-member-consumption .fm-mc-filters {
  border-bottom: 1px solid #ebeef5;
}

.fm-member-consumption .fm-mc-filter-row,
.fm-member-consumption .fm-mc-custom-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid #f2f6fc;
}

.fm-member-consumption .fm-mc-filter-row:last-child,
.fm-member-consumption .fm-mc-custom-row:last-child {
  border-bottom: none;
}

.fm-member-consumption .fm-mc-filter-label {
  flex: 0 0 84px;
  padding-top: 4px;
  font-size: 14px;
  font-weight: 400;
  color: #303133;
  line-height: 1.5;
  text-align: left;
}

.fm-member-consumption .fm-mc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  flex: 1;
  min-width: 0;
}

.fm-member-consumption .fm-mc-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: #606266;
  border-radius: 2px;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
  transition: color 0.15s;
}

.fm-member-consumption .fm-mc-chip:hover {
  color: var(--fm-primary);
}

.fm-member-consumption .fm-mc-chip.is-active {
  color: var(--fm-primary);
  font-weight: 500;
}

.fm-member-consumption .fm-mc-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fm-member-consumption .fm-mc-custom .fm-input {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 13px;
}

.fm-member-consumption .fm-mc-input-num {
  width: 100px;
}

.fm-member-consumption .fm-mc-table-wrap {
  overflow-x: auto;
}

.fm-member-consumption .fm-mc-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  color: #606266;
}

.fm-member-consumption .fm-mc-table thead th {
  padding: 12px 10px;
  background: #fafafa;
  border-bottom: 1px solid #ebeef5;
  font-weight: 500;
  color: #909399;
  text-align: center;
  white-space: nowrap;
}

.fm-member-consumption .fm-mc-table tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid #ebeef5;
  text-align: center;
  vertical-align: middle;
}

.fm-member-consumption .fm-mc-table tbody tr:hover td {
  background: #f5f7fa;
}

.fm-member-consumption .fm-mc-col-seq {
  width: 56px;
}

.fm-member-consumption .fm-mc-col-num {
  width: 110px;
}

.fm-member-consumption .fm-mc-col-action {
  width: 100px;
}

.fm-member-consumption .fm-mc-name {
  color: #303133;
  font-weight: 500;
}

.fm-member-consumption .fm-mc-seq {
  color: #909399;
}

.fm-member-consumption .fm-mc-empty {
  padding: 40px 12px !important;
  text-align: center;
  color: #909399;
}

.fm-member-consumption .fm-mc-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0 4px;
  color: var(--fm-primary);
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
}

.fm-member-consumption .fm-mc-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

.fm-member-consumption .fm-mc-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 12px;
  padding: 12px 16px;
  border-top: 1px solid #ebeef5;
  font-size: 13px;
  color: #606266;
}

.fm-member-consumption .fm-mc-pager__total strong {
  color: var(--fm-primary);
  font-weight: 600;
}

.fm-member-consumption .fm-mc-pager__size {
  height: 28px;
  padding: 0 24px 0 8px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 13px;
  color: #606266;
  background: #fff;
}

.fm-member-consumption .fm-mc-pager__nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
}

.fm-member-consumption .fm-mc-pager__btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  background: #fff;
  color: #606266;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.fm-member-consumption .fm-mc-pager__btn:hover:not(:disabled) {
  color: var(--fm-primary);
  border-color: #c6e2ff;
}

.fm-member-consumption .fm-mc-pager__btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.fm-member-consumption .fm-mc-pager__current {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--fm-primary);
  border-radius: 4px;
  background: var(--fm-primary);
  color: #fff;
  font-size: 13px;
}

.fm-member-consumption .fm-mc-pager__goto-label {
  color: #606266;
}

.fm-member-consumption .fm-mc-pager__goto {
  width: 44px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  text-align: center;
  font-size: 13px;
}

.fm-mc-col-seq {
  width: 52px;
}

/* 会员概览 — 参考零售后台双卡片布局 */
.fm-member-overview {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 100%;
}

.fm-member-overview .fm-mo-page-toolbar {
  display: flex;
  align-items: center;
  min-height: 28px;
}

.fm-member-overview .fm-mo-page-refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  background: none;
  color: #606266;
  font-size: 14px;
  cursor: pointer;
  padding: 4px 0;
}

.fm-member-overview .fm-mo-page-refresh:hover:not(:disabled) {
  color: var(--fm-primary);
}

.fm-member-overview .fm-mo-page-refresh__icon {
  font-size: 16px;
  line-height: 1;
}

.fm-member-overview .fm-mo-card {
  background: #fff;
  border: 1px solid #ebeef5;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
  overflow: hidden;
}

.fm-member-overview .fm-mo-card--chart {
  padding-bottom: 8px;
}

.fm-member-overview .fm-mo-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 14px 16px 10px;
}

.fm-member-overview .fm-mo-card__head--compact {
  padding-bottom: 8px;
}

.fm-member-overview .fm-mo-card__title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm-member-overview .fm-mo-card__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #303133;
}

.fm-member-overview .fm-mo-card__info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid #dcdfe6;
  color: #909399;
  font-size: 11px;
  line-height: 1;
  cursor: help;
}

.fm-member-overview .fm-mo-card__date {
  font-size: 14px;
  color: #606266;
}

.fm-member-overview .fm-mo-card__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin-left: auto;
}

.fm-member-overview .fm-mo-select {
  height: 32px;
  min-width: 108px;
  padding: 0 28px 0 12px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 13px;
  color: #606266;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23909399' d='M3 4.5 6 7.5 9 4.5'/%3E%3C/svg%3E") no-repeat right 10px center;
  appearance: none;
}

.fm-member-overview .fm-mo-select:disabled {
  background-color: #f5f7fa;
  cursor: not-allowed;
}

.fm-member-overview .fm-mo-segment {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.fm-member-overview .fm-mo-segment__btn {
  appearance: none;
  border: none;
  border-right: 1px solid #dcdfe6;
  background: #fff;
  color: #606266;
  font-size: 13px;
  padding: 7px 14px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.fm-member-overview .fm-mo-segment__btn:last-child {
  border-right: none;
}

.fm-member-overview .fm-mo-segment__btn:hover {
  color: var(--fm-primary);
}

.fm-member-overview .fm-mo-segment__btn.is-active {
  background: #f5f7fa;
  color: #303133;
  font-weight: 500;
}

.fm-member-overview .fm-mo-custom-date {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 0 16px 12px;
}

.fm-member-overview .fm-mo-custom-date .fm-input {
  height: 32px;
  border: 1px solid #dcdfe6;
  border-radius: 4px;
  font-size: 13px;
  padding: 0 10px;
}

.fm-member-overview .fm-mo-metrics {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  padding: 4px 16px 16px;
}

.fm-member-overview .fm-mo-metric {
  background: #f5f7fa;
  border-radius: 6px;
  padding: 14px 12px;
  min-width: 0;
}

.fm-member-overview .fm-mo-metric__label-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 10px;
}

.fm-member-overview .fm-mo-metric__label {
  font-size: 13px;
  color: #909399;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fm-member-overview .fm-mo-metric__info {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid #dcdfe6;
  color: #909399;
  font-size: 10px;
  cursor: help;
}

.fm-member-overview .fm-mo-metric__value {
  display: block;
  font-size: 22px;
  font-weight: 600;
  color: #303133;
  line-height: 1.2;
}

.fm-member-overview .fm-mo-indicator-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 16px 12px;
}

.fm-member-overview .fm-mo-indicator-chip {
  appearance: none;
  border: 1px solid #dcdfe6;
  background: #fff;
  color: #606266;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  line-height: 1.35;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.fm-member-overview .fm-mo-indicator-chip:hover {
  border-color: #c0c4cc;
  color: #303133;
}

.fm-member-overview .fm-mo-indicator-chip.is-active {
  background: #f0f2f5;
  border-color: #dcdfe6;
  color: #303133;
  font-weight: 500;
}

.fm-member-overview .fm-mo-chart {
  position: relative;
  margin: 0 16px;
  min-height: 340px;
  border-top: 1px solid #f2f6fc;
  padding-top: 8px;
}

.fm-member-overview .fm-mo-chart__canvas {
  display: block;
  width: 100%;
  height: 300px;
  cursor: default;
}

.fm-member-overview .fm-mo-chart__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px 24px;
  padding: 8px 0 4px;
}

.fm-member-overview .fm-mo-chart__legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #606266;
}

.fm-member-overview .fm-mo-chart__legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.fm-member-overview .fm-mo-chart__tooltip {
  position: absolute;
  top: 16px;
  transform: translateX(-50%);
  padding: 8px 12px;
  border-radius: 4px;
  background: #fff;
  border: 1px solid #ebeef5;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  color: #606266;
  font-size: 12px;
  pointer-events: none;
  white-space: nowrap;
  z-index: 2;
}

.fm-member-overview .fm-mo-chart__tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.fm-member-overview .fm-mo-chart__tooltip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex: 0 0 auto;
}

.fm-member-overview .fm-mo-chart__tooltip strong {
  font-size: 13px;
  color: #303133;
  font-weight: 500;
}

.fm-member-overview .fm-mo-chart__empty {
  padding: 48px 16px;
  text-align: center;
  color: #909399;
  font-size: 14px;
}

@media (max-width: 1200px) {
  .fm-member-overview .fm-mo-metrics {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .fm-member-overview .fm-mo-card__head {
    flex-direction: column;
    align-items: flex-start;
  }

  .fm-member-overview .fm-mo-card__controls {
    margin-left: 0;
    width: 100%;
  }

  .fm-member-overview .fm-mo-segment {
    flex-wrap: wrap;
  }

  .fm-member-overview .fm-mo-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .fm-member-overview .fm-mo-metrics {
    grid-template-columns: 1fr;
  }
}

.fm-mc-tag-hint {
  flex-basis: 100%;
  margin: 0;
  font-size: 12px;
}

.fm-member-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.fm-member-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.fm-member-tag-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fm-member-tag-field__label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
}

.fm-member-tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.fm-member-tag-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.fm-member-tag-option input {
  margin: 0;
}

.fm-member-tag-create {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fm-member-tag-create .fm-input {
  flex: 1;
  min-width: 140px;
}

.fm-member-tags-page .fm-member-tags__filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 0 0 16px;
}

.fm-member-tags-page .fm-member-tags__field {
  flex: 1 1 180px;
  min-width: 0;
  margin: 0;
}

.fm-member-tags-page .fm-member-tags__field--date {
  flex: 0 1 150px;
}

.fm-member-tags-page .fm-member-tags__sep {
  color: var(--fm-muted, #94a3b8);
  font-size: 13px;
}

.fm-balance-records-page .fm-balance-records__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.fm-balance-records-stat {
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}

.fm-balance-records-stat--accent {
  background: linear-gradient(135deg, #eff6ff, #f0fdf4);
  border-color: #bfdbfe;
}

.fm-balance-records-stat__label {
  display: block;
  font-size: 12px;
  color: var(--fm-muted, #64748b);
  margin-bottom: 6px;
}

.fm-balance-records-stat__value {
  font-size: 20px;
  color: #0f172a;
}

.fm-balance-records-page .is-positive {
  color: #16a34a;
}

.fm-balance-records-page .is-debt {
  color: #dc2626;
}

.billing-customer-balance {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
}

.billing-dropdown-item__balance {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: #0369a1;
}

.fm-os-btn--sm {
  min-height: 32px;
  padding: 0 12px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .fm-member-consumption .fm-mc-filter-label {
    flex: 0 0 100%;
    padding-top: 0;
  }

  .fm-member-consumption .fm-mc-search__input {
    max-width: none;
  }
}

.fm-order-detail__meta-primary .fm-os-action--copy {
  min-height: 22px;
  padding: 0 8px;
  font-size: 11px;
  background: #fff;
  border-color: #e2e8f0;
  color: #64748b;
}

.fm-order-detail__meta-primary .fm-os-action--copy:hover {
  border-color: #cbd5e1;
  color: var(--fm-primary);
  background: #f8fafc;
}

.fm-order-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  border: 1px solid transparent;
}

.fm-order-tag--default {
  background: #f1f5f9;
  color: #64748b;
  border-color: #e2e8f0;
}

.fm-order-tag--draft {
  background: #f8fafc;
  color: #64748b;
  border-color: #e2e8f0;
}

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

.fm-order-tag--held {
  background: #ede9fe;
  color: #6d28d9;
  border-color: #c4b5fd;
}

.fm-order-tag--confirmed {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.fm-order-tag--printed {
  background: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

.fm-order-tag--published {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.fm-order-tag--void {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.fm-order-tag--pay-unpaid {
  background: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}

.fm-order-tag--pay-partial {
  background: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.fm-order-tag--pay-paid {
  background: #f0fdf4;
  color: #15803d;
  border-color: #bbf7d0;
}

.fm-order-tag--dash {
  font-size: 12px;
}

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

.fm-order-print-modal {
  max-width: min(560px, 96vw);
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.14);
}

.fm-order-print-modal--wide {
  max-width: min(720px, 96vw);
  max-height: min(90vh, 820px);
  display: flex;
  flex-direction: column;
}

.fm-order-print-modal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--fm-border);
  background: linear-gradient(180deg, #fafbfc 0%, #fff 100%);
}

.fm-order-print-modal__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  color: #0f172a;
}

.fm-order-print-modal__body {
  padding: 14px 16px 16px;
  overflow: auto;
}

.fm-order-print-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}

.fm-order-print-modal .billing-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 4px;
}

.fm-order-print-modal .billing-meta-grid label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  color: var(--fm-muted);
  font-weight: 500;
}

.fm-order-print-modal .billing-meta-grid .fm-select,
.fm-order-print-modal .billing-meta-grid .fm-input {
  max-width: none;
  min-height: 34px;
  border-radius: 8px;
}

.fm-order-print-modal__options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 4px;
}

.fm-order-print-modal__hint {
  margin: 8px 0;
  font-size: 13px;
  color: var(--fm-muted);
}

.fm-order-print-backdrop .fm-os-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  color: #475569;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.fm-order-print-backdrop .fm-os-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.fm-order-print-backdrop .fm-os-btn--primary {
  background: linear-gradient(180deg, #4dabff 0%, var(--fm-primary) 100%);
  border-color: #3a96eb;
  color: #fff;
  box-shadow: 0 1px 2px rgba(64, 158, 255, 0.28);
}

.fm-order-print-backdrop .fm-os-btn--primary:hover:not(:disabled) {
  background: linear-gradient(180deg, #66b8ff 0%, #3a96eb 100%);
  box-shadow: 0 2px 6px rgba(64, 158, 255, 0.32);
}

.fm-order-print-backdrop .fm-os-btn--secondary {
  background: #fff;
  border-color: #dbe3ee;
  color: #64748b;
}

.fm-order-print-backdrop .fm-os-btn--secondary:hover:not(:disabled) {
  background: #f8fafc;
  border-color: #cbd5e1;
  color: #334155;
}

.fm-order-print-backdrop .fm-os-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.fm-order-print-backdrop .fm-os-check:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.fm-order-print-backdrop .fm-os-check:has(input:checked) {
  border-color: #93c5fd;
  background: #eff6ff;
  color: #2563eb;
}

.fm-order-print-backdrop .fm-os-check input {
  margin: 0;
  accent-color: var(--fm-primary);
}

.fm-order-print-modal .billing-print-preview {
  margin-top: 12px;
  max-height: 220px;
  overflow: auto;
  font-size: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

@media (max-width: 640px) {
  .fm-order-print-modal .billing-meta-grid {
    grid-template-columns: 1fr;
  }

  .fm-order-print-modal__actions {
    flex-direction: column;
  }

  .fm-order-print-backdrop .fm-os-btn {
    width: 100%;
  }
}

@media (max-width: 720px) {
  .fm-orders-sales .fm-os-filter-actions {
    width: 100%;
  }

  .fm-orders-sales .fm-os-filter-actions .fm-os-btn {
    flex: 1;
  }

  .fm-orders-sales .fm-os-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 4px;
  }

  .fm-orders-sales .fm-os-action {
    min-height: 26px;
    padding: 0 8px;
  }
}

a.fm-dashboard-info {
  text-decoration: none;
}

body.fm-order-detail-open {
  overflow: hidden;
}

.fm-order-detail-backdrop {
  z-index: 9100;
  padding: 12px;
}

.fm-order-detail-modal {
  max-width: min(820px, 96vw);
  width: 100%;
  max-height: min(88vh, 820px);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.fm-order-detail__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--fm-border);
  flex-shrink: 0;
}

.fm-order-detail__head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.fm-order-detail__close {
  border: none;
  background: #f1f5f9;
  color: #64748b;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.fm-order-detail__close:hover {
  background: #e2e8f0;
  color: #334155;
}

.fm-order-detail__loading {
  padding: 24px 14px;
  text-align: center;
  color: var(--fm-muted);
  font-size: 13px;
}

.fm-order-detail__body {
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 14px 12px;
}

.fm-order-detail__meta {
  padding: 8px 10px;
  margin-bottom: 8px;
  background: #f8fafc;
  border: 1px solid var(--fm-border);
  border-radius: 6px;
}

.fm-order-detail__meta-primary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-bottom: 6px;
}

.fm-order-detail__docno {
  font-size: 14px;
  color: #0f172a;
}

.fm-order-detail__copy {
  font-size: 12px;
  padding: 0;
}

.fm-order-detail__meta-time {
  margin-left: auto;
  font-size: 12px;
  color: var(--fm-muted);
  white-space: nowrap;
}

.fm-tag-sm {
  font-size: 11px;
  padding: 1px 6px;
  line-height: 1.4;
}

.fm-tag-muted {
  background: #e2e8f0;
  color: #475569;
}

.fm-order-detail__meta-kvs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}

.fm-order-detail__kv {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  font-size: 12px;
  color: #334155;
  line-height: 1.35;
  max-width: 100%;
}

.fm-order-detail__kv em {
  font-style: normal;
  color: var(--fm-muted);
  flex-shrink: 0;
}

.fm-order-detail__kv span {
  word-break: break-word;
}

.fm-order-detail__table-wrap {
  border: 1px solid var(--fm-border);
  border-radius: 6px;
}

.fm-order-detail__table {
  min-width: 520px;
  margin: 0;
  font-size: 12px;
}

.fm-order-detail__table th,
.fm-order-detail__table td {
  padding: 6px 8px;
}

.fm-order-detail__table th {
  font-size: 12px;
  white-space: nowrap;
}

.fm-order-detail__num {
  text-align: right;
  white-space: nowrap;
}

.fm-order-detail__empty {
  text-align: center;
  color: var(--fm-muted);
  padding: 16px 8px !important;
}

.fm-order-detail__summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 12px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--fm-border);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: #475569;
}

.fm-order-detail__summary-item strong {
  color: #1e293b;
  font-weight: 600;
}

.fm-order-detail__summary-item strong.is-total {
  color: #dc2626;
  font-size: 14px;
}

.fm-order-detail__summary-item strong.is-debt {
  color: #b45309;
}

.fm-order-detail__summary-item strong.is-discount {
  color: #b45309;
}

.fm-order-detail__summary-total {
  margin-left: auto;
}

.fm-order-detail__summary-divider {
  width: 1px;
  height: 14px;
  background: var(--fm-border);
  flex-shrink: 0;
}

.fm-order-detail__extras {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 6px;
  padding: 0 2px;
  font-size: 12px;
  color: #475569;
}

.fm-order-detail__extra {
  display: flex;
  gap: 6px;
  line-height: 1.4;
}

.fm-order-detail__extra em {
  font-style: normal;
  color: var(--fm-muted);
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .fm-order-detail-modal {
    max-height: 92vh;
    border-radius: 12px 12px 0 0;
  }

  .fm-order-detail-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .fm-order-detail__meta-time {
    margin-left: 0;
    width: 100%;
  }

  .fm-order-detail__summary-total {
    margin-left: 0;
    width: 100%;
    text-align: right;
  }

  .fm-order-detail__summary-divider {
    display: none;
  }
}
