/* IBR backend: 板型图 card — desktop 50% page width, phone full width */
#parametersSection[data-quote-backend="ibr"] > .profile-drawing-card,
#parametersSection[data-quote-backend="ibr"].quote-backend-params-flat > .profile-drawing-card,
#parametersSection[data-quote-backend="paishujiage"] > .profile-drawing-card,
#parametersSection[data-quote-backend="double"] > .profile-drawing-card,
#parametersSection[data-quote-backend="double-glazed"] > .profile-drawing-card,
#parametersSection.quote-backend-params-flat > .profile-drawing-card,
.quote-backend-params-flat > .profile-drawing-card {
  width: 50% !important;
  max-width: 50% !important;
  flex: 0 0 50% !important;
  min-width: 280px !important;
  box-sizing: border-box !important;
  grid-column: auto !important;
  justify-self: start !important;
}
.profile-drawing-card {
  width: 50% !important;
  max-width: 50% !important;
  min-width: 280px !important;
  box-sizing: border-box !important;
}
.profile-drawing-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.profile-drawing-drop {
  position: relative;
  min-height: 180px;
  border: 2px dashed #cfe0f2;
  border-radius: 14px;
  background: #f8fbff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  overflow: hidden;
  padding: 8px;
}
.profile-drawing-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  border: 1px solid #dbe3ef;
  background: #fff;
  color: #0f4c81;
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 76, 129, 0.12);
}
.profile-drawing-remove:hover,
.profile-drawing-remove:focus-visible {
  background: #eef6ff;
  border-color: #0f4c81;
  outline: none;
}
.profile-drawing-drop:focus-visible {
  outline: 2px solid #0f4c81;
  outline-offset: 2px;
}
.profile-drawing-drop.is-dragover {
  border-color: #0f4c81;
  background: #eef6ff;
}
.profile-drawing-drop img {
  max-width: 100%;
  max-height: 320px;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}
.profile-drawing-drop img[hidden],
.profile-drawing-placeholder[hidden] {
  display: none !important;
}
.profile-drawing-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 28px 16px;
  text-align: center;
  pointer-events: none;
}
.profile-drawing-placeholder-icon {
  width: 44px;
  height: 44px;
  color: #0f4c81;
  opacity: 0.7;
}
.profile-drawing-placeholder-title {
  margin: 0;
  color: #0f4c81;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
}
.profile-drawing-placeholder-hint {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.45;
}
.profile-drawing-fields {
  display: grid;
  gap: 8px;
}
.profile-drawing-field {
  display: grid;
  grid-template-columns: minmax(130px, auto) 1fr;
  gap: 8px;
  align-items: baseline;
  font-size: 14px;
  line-height: 1.45;
}
/* Dual 卡只有「备注:」短标签，不要用 130px 首列把输入框顶开 */
.profile-drawing-card-dual .profile-drawing-field {
  grid-template-columns: auto 1fr;
  gap: 6px;
}
.profile-drawing-label {
  color: #0f4c81;
  font-weight: 700;
  white-space: nowrap;
}
.profile-drawing-input {
  width: 100%;
  min-width: 0;
  border: 1px solid #dbe3ef;
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 14px;
  line-height: 1.45;
  color: #111;
  background: #fff;
  box-sizing: border-box;
}
.profile-drawing-input:focus {
  outline: 2px solid #0f4c81;
  outline-offset: 1px;
  border-color: #0f4c81;
}
.profile-drawing-input.is-ocr-pending {
  background: #f8fbff;
}
.profile-drawing-ocr-status {
  margin: 0;
  color: #0f4c81;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
}
.profile-drawing-ocr-status.is-error {
  color: #b45309;
}
.profile-drawing-value {
  color: #111;
  min-width: 0;
  word-break: break-word;
}

.profile-existing-quotes-card {
  grid-column: 1 / -1 !important;
  width: max-content !important;
  max-width: 100% !important;
  flex: 0 0 auto !important;
}

/* Double / DoubleGlazed: 上层、下层板型图上下排列（非左右） */
.profile-drawing-dual,
#parametersSection[data-quote-backend="double"] .profile-drawing-dual,
#parametersSection[data-quote-backend="double-glazed"] .profile-drawing-dual,
.profile-drawing-card-dual .profile-drawing-dual {
  display: grid;
  grid-template-columns: 1fr !important;
  gap: 12px;
}
.profile-drawing-slot {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}
.profile-drawing-slot-label {
  color: #0f4c81;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}
@media (min-width: 901px) {
  #parametersSection[data-quote-backend="double"] > .profile-drawing-card,
  #parametersSection[data-quote-backend="double-glazed"] > .profile-drawing-card,
  .profile-drawing-card-dual {
    width: 50% !important;
    max-width: 50% !important;
    flex: 0 0 50% !important;
    min-width: 280px !important;
    box-sizing: border-box !important;
  }
}

/* Glazed：板型图留在第一行，并吃掉型号卡、报价卡右边的剩余页宽。 */
@media (min-width: 901px) {
  #parametersSection[data-quote-backend="glazed"] > .profile-drawing-card {
    width: auto !important;
    max-width: none !important;
    flex: 1 1 360px !important;
    min-width: 280px !important;
  }
}

@media (max-width: 900px) {
  #parametersSection[data-quote-backend="ibr"] > .profile-drawing-card,
  #parametersSection[data-quote-backend="ibr"].quote-backend-params-flat > .profile-drawing-card,
  #parametersSection[data-quote-backend="paishujiage"] > .profile-drawing-card,
  #parametersSection[data-quote-backend="glazed"] > .profile-drawing-card,
  #parametersSection[data-quote-backend="double"] > .profile-drawing-card,
  #parametersSection[data-quote-backend="double-glazed"] > .profile-drawing-card,
  #parametersSection.quote-backend-params-flat > .profile-drawing-card,
  .quote-backend-params-flat > .profile-drawing-card,
  .profile-drawing-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: 0 0 100% !important;
    min-width: 0 !important;
  }
}
