/**
 * form-v2.css - 郭标财务平台 表单引擎完整样式
 * 设计系统：柠檬云浅色
 * 前缀：fd2-(设计器) fr2-(渲染器) fm2-(管理) fs2-(分享) fai2-(AI审核)
 */

/* ========== 设计令牌 ========== */
.form-engine-wrap {
  --fe-blue: #1890ff;
  --fe-blue-hover: #40a9ff;
  --fe-blue-active: #096dd9;
  --fe-blue-bg: #e6f7ff;
  --fe-green: #52c41a;
  --fe-green-bg: #f6ffed;
  --fe-orange: #fa8c16;
  --fe-orange-bg: #fff7e6;
  --fe-red: #f5222d;
  --fe-red-bg: #fff1f0;
  --fe-gray-1: #fafafa;
  --fe-gray-2: #f5f5f5;
  --fe-gray-3: #f0f0f0;
  --fe-gray-4: #d9d9d9;
  --fe-gray-5: #bfbfbf;
  --fe-gray-6: #8c8c8c;
  --fe-gray-7: #595959;
  --fe-gray-8: #262626;
  --fe-radius: 8px;
  --fe-shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --fe-shadow-md: 0 3px 6px -4px rgba(0, 0, 0, 0.06), 0 6px 16px rgba(0, 0, 0, 0.04);
  --fe-font: 'Noto Sans SC', -apple-system, 'PingFang SC', 'Microsoft YaHei', sans-serif;

  font-family: var(--fe-font);
  font-size: 14px;
  color: var(--fe-gray-8);
  line-height: 1.5;
  box-sizing: border-box;
}

.form-engine-wrap *,
.form-engine-wrap *::before,
.form-engine-wrap *::after {
  box-sizing: border-box;
}

/* ========== 通用按钮 ========== */
.fe-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 13px;
  font-family: var(--fe-font);
  font-weight: 400;
  line-height: 1;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  user-select: none;
  gap: 6px;
}

.fe-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

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

.fe-btn-primary:hover:not(:disabled) {
  background: var(--fe-blue-hover);
  border-color: var(--fe-blue-hover);
}

.fe-btn-primary:active:not(:disabled) {
  background: var(--fe-blue-active);
  border-color: var(--fe-blue-active);
}

.fe-btn-default {
  background: #fff;
  color: var(--fe-gray-7);
  border-color: var(--fe-gray-4);
}

.fe-btn-default:hover:not(:disabled) {
  color: var(--fe-blue);
  border-color: var(--fe-blue);
}

.fe-btn-danger {
  background: #fff;
  color: var(--fe-red);
  border-color: var(--fe-red);
}

.fe-btn-danger:hover:not(:disabled) {
  background: var(--fe-red-bg);
}

.fe-btn-text {
  background: transparent;
  color: var(--fe-blue);
  border-color: transparent;
  padding: 0 8px;
}

.fe-btn-text:hover:not(:disabled) {
  color: var(--fe-blue-hover);
  background: var(--fe-blue-bg);
}

.fe-btn-sm {
  height: 26px;
  padding: 0 10px;
  font-size: 12px;
}

/* ========== Toast ========== */
.fe-toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(-20px);
  background: var(--fe-gray-8);
  color: #fff;
  padding: 8px 20px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 10000;
  opacity: 0;
  transition: all 0.3s ease;
  pointer-events: none;
  box-shadow: var(--fe-shadow-md);
}

.fe-toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ========== 设计器 fd2- ========== */
.fd2-container {
  display: flex;
  height: calc(100vh - 120px);
  background: var(--fe-gray-2);
  overflow: hidden;
}

.fd2-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--fe-gray-3);
}

.fd2-toolbar-left,
.fd2-toolbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fd2-toolbar-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin: 0;
}

/* 左侧面板 */
.fd2-palette {
  width: 240px;
  min-width: 240px;
  background: #fff;
  border-right: 1px solid var(--fe-gray-3);
  overflow-y: auto;
  padding: 12px;
}

.fd2-palette-group {
  margin-bottom: 16px;
}

.fd2-palette-group-title {
  font-size: 12px;
  font-weight: 500;
  color: var(--fe-gray-6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
  padding: 0 4px;
}

.fd2-palette-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 6px;
  cursor: grab;
  transition: all 0.2s ease;
  font-size: 13px;
  color: var(--fe-gray-7);
  border: 1px solid transparent;
}

.fd2-palette-item:hover {
  background: var(--fe-blue-bg);
  color: var(--fe-blue);
  border-color: var(--fe-blue);
}

.fd2-palette-item:active {
  cursor: grabbing;
}

.fd2-palette-icon {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fe-gray-5);
}

.fd2-palette-item:hover .fd2-palette-icon {
  color: var(--fe-blue);
}

/* 中间画布 */
.fd2-canvas {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--fe-gray-2);
}

.fd2-canvas-inner {
  max-width: 680px;
  margin: 0 auto;
  min-height: 400px;
}

.fd2-field-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.fd2-field-card:hover {
  box-shadow: var(--fe-shadow-md);
  border-color: var(--fe-gray-4);
}

.fd2-field-card.fd2-selected {
  border-color: var(--fe-blue);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.fd2-field-card.fd2-dragging {
  opacity: 0.6;
  border-style: dashed;
}

.fd2-drag-handle {
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  cursor: grab;
  color: var(--fe-gray-5);
  padding: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fd2-field-card:hover .fd2-drag-handle {
  opacity: 1;
}

.fd2-field-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 8px;
}

.fd2-field-preview {
  color: var(--fe-gray-6);
  font-size: 13px;
}

.fd2-field-actions {
  position: absolute;
  right: 8px;
  top: 8px;
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.fd2-field-card:hover .fd2-field-actions {
  opacity: 1;
}

.fd2-canvas-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  border: 2px dashed var(--fe-gray-4);
  border-radius: var(--fe-radius);
  color: var(--fe-gray-6);
  font-size: 14px;
}

/* 右侧属性面板 */
.fd2-props {
  width: 320px;
  min-width: 320px;
  background: #fff;
  border-left: 1px solid var(--fe-gray-3);
  overflow-y: auto;
  padding: 16px;
}

.fd2-props-section {
  margin-bottom: 20px;
  border-bottom: 1px solid var(--fe-gray-3);
  padding-bottom: 16px;
}

.fd2-props-section:last-child {
  border-bottom: none;
}

.fd2-props-section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 12px;
}

.fd2-props-row {
  margin-bottom: 12px;
}

.fd2-props-label {
  display: block;
  font-size: 12px;
  color: var(--fe-gray-6);
  margin-bottom: 4px;
}

.fd2-props-input {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--fe-gray-4);
  border-radius: 6px;
  font-size: 13px;
  color: var(--fe-gray-8);
  transition: border-color 0.2s ease;
  outline: none;
}

.fd2-props-input:focus {
  border-color: var(--fe-blue);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 预览弹窗 */
.fd2-preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.fd2-preview-overlay.fd2-preview-open {
  opacity: 1;
}

.fd2-preview-content {
  background: #fff;
  border-radius: var(--fe-radius);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 32px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
}

/* 设置抽屉 */
.fd2-settings-drawer {
  position: fixed;
  top: 0;
  right: -400px;
  width: 400px;
  height: 100vh;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.08);
  z-index: 1001;
  transition: right 0.3s ease;
  overflow-y: auto;
  padding: 24px;
}

.fd2-settings-drawer.fd2-settings-open {
  right: 0;
}

/* ========== 渲染器 fr2- ========== */
.fr2-container {
  max-width: 640px;
  margin: 0 auto;
  background: #fff;
  padding: 32px;
  border-radius: var(--fe-radius);
  box-shadow: var(--fe-shadow-sm);
}

.fr2-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--fe-gray-3);
}

.fr2-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--fe-gray-8);
  margin: 0 0 8px;
}

.fr2-desc {
  font-size: 13px;
  color: var(--fe-gray-6);
  margin: 0;
  line-height: 1.6;
}

.fr2-field-row {
  margin-bottom: 20px;
}

.fr2-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 6px;
}

.fr2-required {
  color: var(--fe-red);
  margin-left: 2px;
}

.fr2-hint {
  font-size: 12px;
  color: var(--fe-gray-6);
  margin-top: 4px;
}

.fr2-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fe-gray-8);
  background: #fff;
  transition: all 0.2s ease;
  outline: none;
  font-family: var(--fe-font);
}

.fr2-input:focus {
  border-color: var(--fe-blue);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.fr2-input::placeholder {
  color: var(--fe-gray-5);
}

.fr2-textarea {
  width: 100%;
  min-height: 80px;
  padding: 8px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fe-gray-8);
  resize: vertical;
  transition: all 0.2s ease;
  outline: none;
  font-family: var(--fe-font);
  line-height: 1.5;
}

.fr2-textarea:focus {
  border-color: var(--fe-blue);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.fr2-select {
  width: 100%;
  height: 36px;
  padding: 0 32px 0 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
  color: var(--fe-gray-8);
  background: #fff url("data:image/svg+xml,%3Csvg width='12' height='12' viewBox='0 0 12 12' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%238c8c8c' stroke-width='1.5'/%3E%3C/svg%3E") no-repeat right 12px center;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: all 0.2s ease;
  outline: none;
}

.fr2-select:focus {
  border-color: var(--fe-blue);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

/* 单选/多选 */
.fr2-radio-group,
.fr2-checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fr2-radio-item,
.fr2-checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--fe-gray-7);
}

.fr2-radio-item input[type="radio"],
.fr2-checkbox-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--fe-blue);
  cursor: pointer;
}

/* 文件上传 */
.fr2-upload-zone {
  border: 2px dashed var(--fe-gray-4);
  border-radius: 6px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  color: var(--fe-gray-6);
  font-size: 13px;
}

.fr2-upload-zone:hover {
  border-color: var(--fe-blue);
  color: var(--fe-blue);
  background: var(--fe-blue-bg);
}

.fr2-upload-zone.fr2-drag-over {
  border-color: var(--fe-blue);
  background: var(--fe-blue-bg);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.15);
}

.fr2-upload-icon {
  margin-bottom: 8px;
  color: var(--fe-gray-5);
}

.fr2-upload-zone:hover .fr2-upload-icon {
  color: var(--fe-blue);
}

/* 签名 */
.fr2-signature-canvas {
  border: 1px dashed var(--fe-gray-4);
  border-radius: 6px;
  width: 100%;
  height: 160px;
  cursor: crosshair;
  touch-action: none;
}

.fr2-signature-actions {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 评分 */
.fr2-rating {
  display: flex;
  gap: 4px;
}

.fr2-rating-star {
  width: 24px;
  height: 24px;
  cursor: pointer;
  color: var(--fe-gray-4);
  transition: color 0.15s ease;
}

.fr2-rating-star.fr2-active {
  color: #faad14;
}

.fr2-rating-star:hover {
  color: #faad14;
}

/* 子表单 */
.fr2-subform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fr2-subform-table th {
  background: var(--fe-gray-2);
  padding: 8px 12px;
  text-align: left;
  font-weight: 500;
  color: var(--fe-gray-7);
  border: 1px solid var(--fe-gray-3);
}

.fr2-subform-table td {
  padding: 8px 12px;
  border: 1px solid var(--fe-gray-3);
  color: var(--fe-gray-8);
}

.fr2-subform-table td input {
  width: 100%;
  border: none;
  outline: none;
  font-size: 13px;
  padding: 4px 0;
}

/* 矩阵 */
.fr2-matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fr2-matrix-table th,
.fr2-matrix-table td {
  border: 1px solid var(--fe-gray-3);
  padding: 8px 10px;
  text-align: center;
}

.fr2-matrix-table th {
  background: var(--fe-gray-1);
  font-weight: 500;
  color: var(--fe-gray-7);
}

/* 进度条 */
.fr2-progress {
  height: 4px;
  background: var(--fe-gray-3);
  border-radius: 2px;
  margin-bottom: 20px;
  overflow: hidden;
}

.fr2-progress-bar {
  height: 100%;
  background: var(--fe-blue);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 分页导航 */
.fr2-page-nav {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--fe-gray-3);
}

/* 错误提示 */
.fr2-error {
  font-size: 12px;
  color: var(--fe-red);
  margin-top: 4px;
}

.fr2-field-row.fr2-has-error .fr2-input,
.fr2-field-row.fr2-has-error .fr2-textarea,
.fr2-field-row.fr2-has-error .fr2-select {
  border-color: var(--fe-red);
}

/* 成功页 */
.fr2-success {
  text-align: center;
  padding: 48px 24px;
}

.fr2-success-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--fe-green-bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--fe-green);
}

.fr2-success-title {
  font-size: 18px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 8px;
}

.fr2-success-desc {
  font-size: 14px;
  color: var(--fe-gray-6);
}

/* ========== 管理 fm2- ========== */
.fm2-wrap {
  padding: 20px;
  background: var(--fe-gray-2);
  min-height: calc(100vh - 120px);
}

.fm2-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 12px;
}

.fm2-topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fm2-topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.fm2-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--fe-gray-8);
  margin: 0;
}

.fm2-create-group {
  display: flex;
  align-items: center;
  gap: 2px;
}

.fm2-btn-dropdown {
  padding: 0 8px;
  border-left: none;
  border-radius: 0 6px 6px 0;
}

.fm2-create-group .fe-btn-primary {
  border-radius: 6px 0 0 6px;
}

.fm2-search {
  position: relative;
}

.fm2-search-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--fe-gray-5);
}

.fm2-search-input {
  width: 200px;
  height: 32px;
  padding: 0 12px 0 30px;
  border: 1px solid var(--fe-gray-4);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: all 0.2s ease;
}

.fm2-search-input:focus {
  border-color: var(--fe-blue);
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
  width: 240px;
}

.fm2-tabs {
  display: flex;
  gap: 4px;
  background: var(--fe-gray-2);
  border-radius: 6px;
  padding: 3px;
}

.fm2-tab {
  padding: 4px 12px;
  font-size: 13px;
  color: var(--fe-gray-6);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
}

.fm2-tab:hover {
  color: var(--fe-gray-8);
}

.fm2-tab.active {
  background: #fff;
  color: var(--fe-blue);
  box-shadow: var(--fe-shadow-sm);
}

/* 下拉菜单 */
.fm2-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  background: #fff;
  border: 1px solid var(--fe-gray-3);
  border-radius: 6px;
  box-shadow: var(--fe-shadow-md);
  z-index: 100;
  min-width: 120px;
  padding: 4px;
}

.fm2-dropdown-right {
  left: auto;
  right: 0;
}

.fm2-dropdown-item {
  padding: 8px 12px;
  font-size: 13px;
  color: var(--fe-gray-7);
  cursor: pointer;
  border-radius: 4px;
  transition: background 0.15s ease;
}

.fm2-dropdown-item:hover {
  background: var(--fe-gray-1);
  color: var(--fe-blue);
}

.fm2-dropdown-danger {
  color: var(--fe-red);
}

.fm2-dropdown-danger:hover {
  background: var(--fe-red-bg);
  color: var(--fe-red);
}

/* 表单卡片网格 */
.fm2-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}

.fm2-card {
  background: #fff;
  border: 1px solid #e8e8e8;
  border-radius: var(--fe-radius);
  padding: 20px;
  transition: all 0.2s ease;
  cursor: default;
}

.fm2-card:hover {
  box-shadow: var(--fe-shadow-md);
  border-color: var(--fe-gray-4);
}

.fm2-card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.fm2-card-icon {
  flex-shrink: 0;
}

.fm2-card-info {
  flex: 1;
  min-width: 0;
}

.fm2-card-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm2-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm2-card-tag {
  font-size: 11px;
  color: var(--fe-gray-6);
  background: var(--fe-gray-2);
  padding: 1px 6px;
  border-radius: 3px;
}

.fm2-card-stats {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--fe-gray-3);
}

.fm2-stat-item {
  font-size: 12px;
  color: var(--fe-gray-6);
}

.fm2-card-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.fm2-more-wrap {
  position: relative;
}

/* 状态徽章 */
.fm2-badge {
  display: inline-block;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 10px;
  font-weight: 400;
  line-height: 18px;
}

.fm2-badge-gray {
  background: var(--fe-gray-2);
  color: var(--fe-gray-6);
}

.fm2-badge-green {
  background: var(--fe-green-bg);
  color: var(--fe-green);
}

.fm2-badge-red {
  background: var(--fe-red-bg);
  color: var(--fe-red);
}

.fm2-badge-blue {
  background: var(--fe-blue-bg);
  color: var(--fe-blue);
}

/* 空状态 */
.fm2-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  color: var(--fe-gray-6);
}

.fm2-empty-icon {
  margin-bottom: 16px;
  opacity: 0.6;
}

.fm2-empty-text {
  font-size: 14px;
  color: var(--fe-gray-6);
}

/* 分页 */
.fm2-pagination {
  margin-top: 24px;
  display: flex;
  justify-content: center;
}

.fm2-pager {
  display: flex;
  align-items: center;
  gap: 6px;
}

.fm2-pager-ellipsis {
  color: var(--fe-gray-5);
  padding: 0 4px;
}

.fm2-pager-info {
  font-size: 13px;
  color: var(--fe-gray-6);
  padding: 0 8px;
}

/* 数据抽屉 */
.fm2-drawer {
  position: fixed;
  inset: 0;
  z-index: 900;
}

.fm2-drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fm2-drawer-open .fm2-drawer-mask {
  opacity: 1;
}

.fm2-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: 80%;
  max-width: 1200px;
  height: 100%;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.fm2-drawer-open .fm2-drawer-panel {
  transform: translateX(0);
}

.fm2-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--fe-gray-3);
  flex-shrink: 0;
}

.fm2-drawer-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fm2-drawer-title h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--fe-gray-8);
}

.fm2-drawer-count {
  font-size: 13px;
  color: var(--fe-gray-6);
}

.fm2-drawer-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fm2-drawer-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

/* 统计卡片 */
.fm2-stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.fm2-stat-card {
  background: var(--fe-gray-1);
  border-radius: var(--fe-radius);
  padding: 16px;
  text-align: center;
}

.fm2-stat-value {
  font-size: 24px;
  font-weight: 600;
  color: var(--fe-gray-8);
  margin-bottom: 4px;
}

.fm2-stat-label {
  font-size: 12px;
  color: var(--fe-gray-6);
}

/* 图表 */
.fm2-charts-section {
  margin-bottom: 24px;
}

.fm2-chart-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.fm2-chart-box {
  background: var(--fe-gray-1);
  border-radius: var(--fe-radius);
  padding: 16px;
}

.fm2-chart-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--fe-gray-7);
  margin-bottom: 12px;
}

.fm2-chart {
  height: 280px;
  width: 100%;
}

/* 提交表格 */
.fm2-submissions {
  margin-top: 8px;
}

.fm2-sub-filter {
  display: flex;
  gap: 4px;
  margin-bottom: 12px;
  background: var(--fe-gray-2);
  border-radius: 6px;
  padding: 3px;
  width: fit-content;
}

.fm2-sub-table-wrap {
  overflow-x: auto;
}

.fm2-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.fm2-table th {
  background: var(--fe-gray-1);
  padding: 10px 12px;
  text-align: left;
  font-weight: 500;
  color: var(--fe-gray-7);
  border-bottom: 1px solid var(--fe-gray-3);
  white-space: nowrap;
}

.fm2-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--fe-gray-3);
  color: var(--fe-gray-7);
}

.fm2-table tbody tr {
  transition: background 0.15s ease;
}

.fm2-table tbody tr:hover {
  background: var(--fe-gray-1);
}

.fm2-table-empty {
  text-align: center;
  color: var(--fe-gray-5);
  padding: 32px !important;
}

.fm2-sub-actions {
  white-space: nowrap;
}

.fm2-btn-danger-text {
  color: var(--fe-red) !important;
}

.fm2-btn-danger-text:hover {
  background: var(--fe-red-bg) !important;
}

.fm2-sub-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
}

/* 详情弹窗 */
.fm2-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm2-modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.fm2-modal-open .fm2-modal-mask {
  opacity: 1;
}

.fm2-modal-panel {
  position: relative;
  background: #fff;
  border-radius: var(--fe-radius);
  width: 90%;
  max-width: 720px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.12);
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.25s ease;
}

.fm2-modal-open .fm2-modal-panel {
  transform: scale(1);
  opacity: 1;
}

.fm2-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--fe-gray-3);
  flex-shrink: 0;
}

.fm2-modal-header h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.fm2-modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.fm2-modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 24px;
  border-top: 1px solid var(--fe-gray-3);
  flex-shrink: 0;
}

/* 详情内容 */
.fm2-detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--fe-gray-1);
  border-radius: 6px;
}

.fm2-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: var(--fe-gray-8);
}

.fm2-meta-label {
  font-size: 12px;
  color: var(--fe-gray-6);
}

.fm2-detail-fields {
  margin-bottom: 20px;
}

.fm2-field-row {
  display: flex;
  padding: 10px 0;
  border-bottom: 1px solid var(--fe-gray-3);
  gap: 16px;
}

.fm2-field-row:last-child {
  border-bottom: none;
}

.fm2-field-label {
  width: 140px;
  min-width: 140px;
  font-size: 13px;
  font-weight: 500;
  color: var(--fe-gray-7);
}

.fm2-field-value {
  flex: 1;
  font-size: 13px;
  color: var(--fe-gray-8);
  word-break: break-all;
}

.fm2-field-img {
  max-width: 200px;
  max-height: 120px;
  border-radius: 4px;
  border: 1px solid var(--fe-gray-3);
}

.fm2-field-signature {
  max-height: 80px;
}

.fm2-field-link {
  color: var(--fe-blue);
  text-decoration: none;
}

.fm2-field-link:hover {
  text-decoration: underline;
}

.fm2-subform-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.fm2-subform-table td {
  border: 1px solid var(--fe-gray-3);
  padding: 6px 10px;
}

/* 模板库 */
.fm2-template-panel {
  max-width: 860px;
}

.fm2-tpl-categories {
  display: flex;
  gap: 4px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--fe-gray-3);
  background: var(--fe-gray-1);
}

.fm2-tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
}

.fm2-tpl-card {
  background: #fff;
  border: 1px solid var(--fe-gray-3);
  border-radius: var(--fe-radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.fm2-tpl-card:hover {
  border-color: var(--fe-blue);
  box-shadow: var(--fe-shadow-md);
}

.fm2-tpl-icon {
  margin-bottom: 10px;
}

.fm2-tpl-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 4px;
}

.fm2-tpl-desc {
  font-size: 12px;
  color: var(--fe-gray-6);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fm2-tpl-cat {
  font-size: 11px;
  color: var(--fe-blue);
  background: var(--fe-blue-bg);
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
}

.fm2-loading {
  text-align: center;
  padding: 40px;
  color: var(--fe-gray-6);
  font-size: 13px;
}

/* ========== 分享 fs2- ========== */
.fs2-panel-wrap {
  position: fixed;
  inset: 0;
  z-index: 950;
}

.fs2-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.fs2-open .fs2-mask {
  opacity: 1;
}

.fs2-drawer {
  position: absolute;
  top: 0;
  right: 0;
  width: 420px;
  height: 100%;
  background: #fff;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.08);
}

.fs2-open .fs2-drawer {
  transform: translateX(0);
}

.fs2-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--fe-gray-3);
  flex-shrink: 0;
}

.fs2-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--fe-gray-8);
  margin: 0;
}

.fs2-close-btn {
  color: var(--fe-gray-6);
}

.fs2-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

.fs2-section {
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--fe-gray-3);
}

.fs2-section:last-child {
  border-bottom: none;
}

.fs2-section-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 12px;
}

.fs2-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.fs2-section-header .fs2-section-title {
  margin-bottom: 0;
}

/* 链接行 */
.fs2-link-row {
  display: flex;
  gap: 8px;
}

.fs2-link-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--fe-gray-4);
  border-radius: 6px;
  font-size: 12px;
  color: var(--fe-gray-7);
  background: var(--fe-gray-1);
  outline: none;
}

/* 二维码 */
.fs2-qr-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px;
  background: var(--fe-gray-1);
  border-radius: var(--fe-radius);
}

.fs2-qr-img {
  border-radius: 4px;
}

.fs2-qr-tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--fe-gray-6);
}

/* 渠道列表 */
.fs2-channel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fs2-channel-empty {
  text-align: center;
  padding: 20px;
  color: var(--fe-gray-5);
  font-size: 13px;
  border: 1px dashed var(--fe-gray-4);
  border-radius: 6px;
}

.fs2-channel-item {
  position: relative;
  border: 1px solid var(--fe-gray-3);
  border-radius: 6px;
  padding: 12px;
  padding-right: 36px;
}

.fs2-channel-info {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.fs2-channel-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--fe-gray-8);
}

.fs2-channel-code {
  font-size: 11px;
  color: var(--fe-gray-6);
  background: var(--fe-gray-2);
  padding: 1px 6px;
  border-radius: 3px;
}

.fs2-channel-meta {
  margin-bottom: 6px;
}

.fs2-channel-count {
  font-size: 12px;
  color: var(--fe-gray-6);
}

.fs2-channel-url {
  display: flex;
  gap: 6px;
  align-items: center;
}

.fs2-channel-url-input {
  flex: 1;
  height: 26px;
  padding: 0 8px;
  border: 1px solid var(--fe-gray-3);
  border-radius: 4px;
  font-size: 11px;
  color: var(--fe-gray-6);
  background: var(--fe-gray-1);
  outline: none;
}

.fs2-channel-del {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--fe-gray-5);
  padding: 2px;
  transition: color 0.2s ease;
}

.fs2-channel-del:hover {
  color: var(--fe-red);
}

/* 设置 */
.fs2-settings {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.fs2-setting-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fs2-setting-label {
  width: 90px;
  min-width: 90px;
  font-size: 13px;
  color: var(--fe-gray-7);
}

.fs2-input {
  flex: 1;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--fe-gray-4);
  border-radius: 6px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s ease;
}

.fs2-input:focus {
  border-color: var(--fe-blue);
}

.fs2-textarea {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--fe-gray-4);
  border-radius: 6px;
  font-size: 13px;
  resize: vertical;
  outline: none;
  font-family: var(--fe-font);
  transition: border-color 0.2s ease;
}

.fs2-textarea:focus {
  border-color: var(--fe-blue);
}

/* 开关 */
.fs2-toggle {
  position: relative;
  display: inline-block;
  width: 36px;
  height: 20px;
  cursor: pointer;
}

.fs2-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.fs2-toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--fe-gray-4);
  border-radius: 10px;
  transition: background 0.2s ease;
}

.fs2-toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease;
}

.fs2-toggle input:checked + .fs2-toggle-slider {
  background: var(--fe-blue);
}

.fs2-toggle input:checked + .fs2-toggle-slider::before {
  transform: translateX(16px);
}

.fs2-setting-actions {
  padding-top: 4px;
}

/* 嵌入代码 */
.fs2-embed {
  position: relative;
}

.fs2-embed-code {
  width: 100%;
  font-size: 11px;
  font-family: 'SFMono-Regular', Consolas, monospace;
  background: var(--fe-gray-1);
  color: var(--fe-gray-7);
}

.fs2-embed .fe-btn {
  position: absolute;
  top: 6px;
  right: 6px;
}

/* 底部按钮 */
.fs2-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid var(--fe-gray-3);
  flex-shrink: 0;
}

/* 微信弹窗 */
.fs2-wechat-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.fs2-wechat-box {
  background: #fff;
  border-radius: var(--fe-radius);
  padding: 24px;
  text-align: center;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.fs2-wechat-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 16px;
}

.fs2-wechat-tip {
  font-size: 12px;
  color: var(--fe-gray-6);
  margin: 12px 0;
}

.fs2-wechat-close {
  margin-top: 8px;
}

/* ========== AI 审核 fai2- ========== */
.fai2-section {
  margin-top: 20px;
  padding: 16px;
  background: var(--fe-gray-1);
  border-radius: var(--fe-radius);
}

.fai2-header {
  font-size: 14px;
  font-weight: 500;
  color: var(--fe-gray-8);
  margin-bottom: 12px;
}

.fai2-score-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 600;
  margin: 0 auto 16px;
  border: 4px solid;
}

.fai2-score-high {
  border-color: var(--fe-green);
  color: var(--fe-green);
  background: var(--fe-green-bg);
}

.fai2-score-mid {
  border-color: var(--fe-orange);
  color: var(--fe-orange);
  background: var(--fe-orange-bg);
}

.fai2-score-low {
  border-color: var(--fe-red);
  color: var(--fe-red);
  background: var(--fe-red-bg);
}

.fai2-issues {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.fai2-issue {
  padding: 10px 12px;
  border-radius: 4px;
  font-size: 13px;
  border-left: 3px solid;
  background: #fff;
}

.fai2-severity-high {
  border-left-color: var(--fe-red);
  color: var(--fe-red);
}

.fai2-severity-medium {
  border-left-color: var(--fe-orange);
  color: var(--fe-orange);
}

.fai2-severity-low,
.fai2-severity-info {
  border-left-color: var(--fe-blue);
  color: var(--fe-gray-7);
}

.fai2-suggestions {
  margin-top: 12px;
  padding-left: 0;
  list-style: none;
  counter-reset: fai2-counter;
}

.fai2-suggestions li {
  counter-increment: fai2-counter;
  padding: 6px 0 6px 24px;
  position: relative;
  font-size: 13px;
  color: var(--fe-gray-7);
}

.fai2-suggestions li::before {
  content: counter(fai2-counter);
  position: absolute;
  left: 0;
  top: 6px;
  width: 18px;
  height: 18px;
  background: var(--fe-blue-bg);
  color: var(--fe-blue);
  border-radius: 50%;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .fm2-topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .fm2-topbar-right {
    width: 100%;
    flex-wrap: wrap;
  }

  .fm2-grid {
    grid-template-columns: 1fr;
  }

  .fm2-stats-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .fm2-chart-row {
    grid-template-columns: 1fr;
  }

  .fm2-drawer-panel {
    width: 100%;
    max-width: 100%;
  }

  .fm2-detail-meta {
    grid-template-columns: repeat(2, 1fr);
  }

  .fm2-field-row {
    flex-direction: column;
    gap: 4px;
  }

  .fm2-field-label {
    width: auto;
    min-width: auto;
  }

  .fd2-container {
    flex-direction: column;
    height: auto;
  }

  .fd2-palette {
    width: 100%;
    min-width: auto;
    max-height: 200px;
    border-right: none;
    border-bottom: 1px solid var(--fe-gray-3);
  }

  .fd2-props {
    width: 100%;
    min-width: auto;
    border-left: none;
    border-top: 1px solid var(--fe-gray-3);
  }

  .fr2-container {
    padding: 20px 16px;
    border-radius: 0;
  }

  .fs2-drawer {
    width: 100%;
  }

  .fm2-modal-panel {
    width: 95%;
    max-height: 90vh;
  }

  .fm2-search-input {
    width: 160px;
  }

  .fm2-search-input:focus {
    width: 180px;
  }
}

@media (max-width: 480px) {
  .fm2-wrap {
    padding: 12px;
  }

  .fm2-card {
    padding: 14px;
  }

  .fm2-stats-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .fm2-stat-card {
    padding: 12px;
  }

  .fm2-stat-value {
    font-size: 18px;
  }

  .fm2-chart {
    height: 200px;
  }

  .fm2-detail-meta {
    grid-template-columns: 1fr;
  }

  .fm2-modal-footer {
    flex-direction: column;
  }

  .fm2-modal-footer .fe-btn {
    width: 100%;
  }

  .fs2-footer {
    flex-wrap: wrap;
  }

  .fs2-footer .fe-btn {
    flex: 1;
  }

  .fr2-page-nav {
    flex-direction: column;
  }

  .fr2-page-nav .fe-btn {
    width: 100%;
  }

  .fm2-tpl-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .fm2-tabs {
    overflow-x: auto;
  }
}

/* ========== 打印样式 ========== */
@media print {
  .form-engine-wrap {
    --fe-shadow-sm: none;
    --fe-shadow-md: none;
  }

  .fr2-container {
    max-width: 100%;
    box-shadow: none;
    padding: 0;
  }

  .fr2-upload-zone,
  .fr2-signature-actions,
  .fr2-page-nav {
    display: none;
  }

  .fr2-input,
  .fr2-textarea,
  .fr2-select {
    border: none;
    border-bottom: 1px solid #000;
    border-radius: 0;
    box-shadow: none;
  }

  .fm2-topbar,
  .fm2-card-actions,
  .fm2-pagination,
  .fs2-panel-wrap,
  .fm2-drawer,
  .fm2-modal {
    display: none !important;
  }

  .fe-toast {
    display: none !important;
  }
}

/* ========== 滚动条美化 ========== */
.form-engine-wrap ::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.form-engine-wrap ::-webkit-scrollbar-track {
  background: transparent;
}

.form-engine-wrap ::-webkit-scrollbar-thumb {
  background: var(--fe-gray-4);
  border-radius: 3px;
}

.form-engine-wrap ::-webkit-scrollbar-thumb:hover {
  background: var(--fe-gray-5);
}

/* ========== 动画 ========== */
@keyframes fe-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fe-slide-up {
  from { transform: translateY(12px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fe-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.fm2-card {
  animation: fe-slide-up 0.25s ease both;
}

.fm2-grid .fm2-card:nth-child(2) { animation-delay: 0.05s; }
.fm2-grid .fm2-card:nth-child(3) { animation-delay: 0.1s; }
.fm2-grid .fm2-card:nth-child(4) { animation-delay: 0.15s; }
.fm2-grid .fm2-card:nth-child(5) { animation-delay: 0.2s; }
.fm2-grid .fm2-card:nth-child(6) { animation-delay: 0.25s; }
