.pitemi-view.view {
  background: #eef5fb;
  padding: 0 !important;
  max-width: none;
  margin: 0;
  min-height: 0;
}

.pitemi-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;
  /* 顶距由 app.css --page-safe-top 统一；勿再单独设 padding-top */
  padding-top: var(--page-safe-top) !important;
  padding-right: 0 !important;
  padding-bottom: 0 !important;
  padding-left: 0 !important;
}

.pitemi-scroll {
  flex: 1;
  min-height: 0;
  height: 0; /* 强制内部滚动（Android WebView） */
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
  padding: 10px 10px max(100px, calc(24px + env(safe-area-inset-bottom, 0px)));
}

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

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

.pitemi-guide-text {
  font-size: 13px;
  color: #12335b;
  line-height: 1.8;
}

.pitemi-tip {
  margin-top: 8px;
  background: #f0f9ff;
  border-radius: 4px;
  padding: 8px;
  font-size: 12px;
  color: #456;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pitemi-tip-title {
  font-weight: 600;
  color: #12335b;
  margin-bottom: 2px;
}

.pitemi-tip-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.pitemi-copy-btn {
  border: 1px solid #2e6bd9;
  background: #fff;
  color: #2e6bd9;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 11px;
  cursor: pointer;
}

.pitemi-example {
  color: #7b92ab;
  font-size: 11px;
}

.pitemi-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.pitemi-tag {
  background: #2e6bd9;
  color: #fff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 11px;
}

.pitemi-target-row {
  display: flex;
  gap: 8px;
}

.pitemi-target-btn {
  flex: 1;
  padding: 12px 8px;
  border: 1px solid #d5e0ec;
  border-radius: 8px;
  background: #f7fafc;
  color: #456;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.pitemi-target-btn.active {
  background: linear-gradient(135deg, #2e6bd9 0%, #1f56c0 100%);
  color: #fff;
  border-color: transparent;
}

.pitemi-choose-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px;
  border: 2px dashed #2e6bd9;
  border-radius: 10px;
  background: #f0f6ff;
  color: #2e6bd9;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.pitemi-choose-icon { font-size: 20px; font-weight: 600; }

.pitemi-stat-row {
  display: flex;
  justify-content: space-around;
  text-align: center;
}

.pitemi-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #12335b;
}

.pitemi-stat-num.ok { color: #34c759; }
.pitemi-stat-num.err { color: #ff3b30; }

.pitemi-stat-label {
  font-size: 12px;
  color: #7b92ab;
  margin-top: 2px;
}

.pitemi-error-title { color: #ff3b30; }

.pitemi-error-item {
  display: flex;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 12px;
}

.pitemi-error-line { color: #ff3b30; font-weight: 600; white-space: nowrap; }
.pitemi-error-msg { color: #666; }

.pitemi-preview-table {
  border: 1px solid #e8eef6;
  border-radius: 6px;
  overflow: hidden;
}

.pitemi-preview-head,
.pitemi-preview-row {
  display: flex;
}

.pitemi-preview-head {
  background: #eef5fb;
  font-weight: 600;
}

.pitemi-preview-row {
  border-top: 1px solid #eef2f7;
}

.pitemi-preview-cell {
  flex: 1;
  min-width: 0;
  padding: 8px 6px;
  font-size: 11px;
  color: #12335b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pitemi-preview-head .pitemi-preview-cell {
  color: #456;
}

.pitemi-result-ok {
  color: #34c759;
  font-weight: 600;
}

.pitemi-result-err {
  color: #ff3b30;
}

.pitemi-bottom {
  flex-shrink: 0;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-top: 1px solid #e8eef6;
}

.pitemi-import-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: linear-gradient(135deg, #2e6bd9 0%, #1f56c0 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.pitemi-import-btn:disabled { opacity: 0.6; cursor: not-allowed; }

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