/* Pro-inspection-items-add 复刻 */
.pitema-view.view {
  background: #eef5fb;
  padding: 0 !important;
  max-width: none;
  margin: 0;
  min-height: 0;
}

.pitema-view.view.active {
  display: flex !important;
  flex-direction: column;
  position: fixed;
  inset: 0;
  z-index: 80;
  width: 100%;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  padding-top: var(--page-safe-top) !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
}

.pitema-scroll {
  flex: 1;
  min-height: 0;
  height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 10px 10px max(80px, calc(24px + env(safe-area-inset-bottom, 0px)));
}

.pitema-section {
  background: #fff;
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 8px;
}

.pitema-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #12335b;
  margin-bottom: 8px;
}

.pitema-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.pitema-title-row .pitema-section-title { margin-bottom: 0; }

.pitema-switch-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.pitema-switch-inline {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #7b92ab;
}

.pitema-btn-group {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.pitema-save-btn,
.pitema-import-btn {
  border: none;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  cursor: pointer;
}

.pitema-save-btn {
  background: linear-gradient(135deg, #2e6bd9 0%, #1f56c0 100%);
}

.pitema-import-btn {
  background: linear-gradient(135deg, #34c759 0%, #2aad4a 100%);
}

.pitema-form-item { margin-bottom: 10px; }

.pitema-label {
  display: block;
  font-size: 13px;
  color: #7b92ab;
  margin-bottom: 5px;
}

.pitema-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 5px;
}

.pitema-input {
  width: 100%;
  box-sizing: border-box;
  background: #eef5fb;
  border: none;
  border-radius: 5px;
  padding: 8px;
  font-size: 14px;
}

.pitema-inline-add {
  font-size: 12px;
  color: #2e6bd9;
  padding: 3px 8px;
  background: #edf4ff;
  border-radius: 4px;
  border: none;
  cursor: pointer;
}

.pitema-inline-add.disabled {
  color: #ccc;
  background: #f5f5f5;
  cursor: not-allowed;
}

.pitema-category-list,
.pitema-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.pitema-option {
  padding: 5px 9px;
  background: #eef5fb;
  border-radius: 3px;
  font-size: 12px;
  color: #7b92ab;
  border: none;
  cursor: pointer;
}

.pitema-option.active {
  background: linear-gradient(135deg, #2e6bd9 0%, #1f56c0 100%);
  color: #fff;
}

.pitema-mode-selector {
  display: flex;
  background: #eef5fb;
  border-radius: 5px;
  padding: 2px;
}

.pitema-mode-item {
  flex: 1;
  text-align: center;
  padding: 6px;
  font-size: 13px;
  color: #7b92ab;
  border-radius: 3px;
  border: none;
  background: none;
  cursor: pointer;
}

.pitema-mode-item.active {
  background: linear-gradient(135deg, #2e6bd9 0%, #1f56c0 100%);
  color: #fff;
}

.pitema-switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.pitema-tip {
  background: #f0f9ff;
  border-radius: 3px;
  padding: 7px;
  margin-top: 6px;
  font-size: 12px;
  color: #2e6bd9;
}

.pitema-position-item {
  background: #eef5fb;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
}

.pitema-position-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pitema-position-index {
  font-size: 14px;
  font-weight: 600;
  color: #12335b;
}

.pitema-pos-del {
  padding: 4px 10px;
  background: #ff3b30;
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 12px;
  cursor: pointer;
}

.pitema-add-position {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #eef5fb;
  border-radius: 6px;
  border: 1px dashed #2e6bd9;
  color: #2e6bd9;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border-width: 1px;
  border-style: dashed;
}

.pitema-empty-tip {
  font-size: 13px;
  color: #7b92ab;
  padding: 10px 0;
}

.pitema-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1300;
}

.pitema-mask.hidden { display: none; }

.pitema-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border-radius: 8px;
  padding: 20px;
  width: min(88vw, 400px);
  z-index: 1301;
}

.pitema-modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #12335b;
  text-align: center;
  margin-bottom: 15px;
}

.pitema-modal-input {
  width: 100%;
  box-sizing: border-box;
  background: #eef5fb;
  border: none;
  border-radius: 6px;
  padding: 10px;
  font-size: 14px;
  margin-bottom: 15px;
}

.pitema-parent-list {
  max-height: 150px;
  overflow-y: auto;
  border: 1px solid #dbe8f4;
  border-radius: 6px;
  margin-bottom: 15px;
}

.pitema-parent-item {
  padding: 10px 12px;
  font-size: 14px;
  color: #7b92ab;
  border-bottom: 1px solid #dbe8f4;
  cursor: pointer;
}

.pitema-parent-item:last-child { border-bottom: none; }

.pitema-parent-item.active {
  background: linear-gradient(135deg, #2e6bd9 0%, #1f56c0 100%);
  color: #fff;
}

.pitema-modal-foot {
  display: flex;
  gap: 10px;
}

.pitema-modal-btn {
  flex: 1;
  padding: 10px 0;
  border-radius: 6px;
  font-size: 15px;
  text-align: center;
  border: none;
  cursor: pointer;
}

.pitema-modal-btn.cancel { background: #eef5fb; color: #7b92ab; }
.pitema-modal-btn.confirm {
  background: linear-gradient(135deg, #2e6bd9 0%, #1f56c0 100%);
  color: #fff;
}

.pitema-loading {
  text-align: center;
  padding: 40px;
  color: #7b92ab;
}

.pitema-hidden { display: none !important; }
