/* 提示词规则优化器：左右分栏布局 */
.pro-layout {
  display: grid;
  grid-template-columns: minmax(300px, 42%) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.pro-rules-panel {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 120px);
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.pro-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.pro-panel-head .card-title {
  margin: 0;
}

.pro-rules-text {
  flex: 1;
  min-height: 320px;
  max-height: calc(100vh - 260px);
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.pro-work-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pro-test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
}

.pro-image-labels {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 10px;
}

.pro-image-label-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pro-image-label-row img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.pro-image-label-row input {
  flex: 1;
}

.pro-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 420px;
  overflow-y: auto;
  padding: 4px 0;
}

.pro-thread-empty {
  margin: 0;
}

.pro-turn {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  background: var(--surface-muted, #fafafa);
}

.pro-turn-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  color: var(--text-muted);
}

.pro-turn-label {
  font-weight: 600;
  color: var(--text);
}

.pro-turn-block {
  margin-top: 8px;
}

.pro-turn-block-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.pro-turn-block-body {
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 14px;
  line-height: 1.55;
}

.pro-turn-revision {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: #eef6ff;
  border: 1px solid #c8dff7;
  font-size: 13px;
  line-height: 1.5;
}

.pro-feedback-wrap {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pro-feedback-wrap.hidden {
  display: none;
}

.pro-local-upload {
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-muted, #fafafa);
}

.pro-local-upload.is-dragover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.pro-local-upload input {
  display: none;
}

.pro-local-preview-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}

.pro-local-preview-item {
  position: relative;
  width: 88px;
}

.pro-local-preview-item img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.pro-local-preview-item button {
  position: absolute;
  top: 4px;
  right: 4px;
  padding: 2px 6px;
  font-size: 11px;
  line-height: 1.2;
}

@media (max-width: 960px) {
  .pro-layout {
    grid-template-columns: 1fr;
  }

  .pro-rules-panel {
    position: static;
    max-height: none;
  }

  .pro-rules-text {
    max-height: 360px;
  }
}
