.qh-image-region {
  color: #17233b;
  background: #fff;
  border: 1px solid #dfe8f4;
  border-radius: 18px;
  padding: 24px;
  box-shadow: 0 14px 34px rgba(43, 77, 119, .08);
}

.qh-image-intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 22px;
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 1px solid #edf1f7;
}

.qh-image-intro h3,
.qh-image-body h4 {
  margin: 0;
  color: #14213d;
  font-size: 27px;
  line-height: 1.2;
}

.qh-image-intro p,
.qh-image-body > p {
  margin: 9px 0 0;
  color: #40516b;
  font-size: 14px;
  line-height: 1.75;
}

.qh-image-cost {
  display: grid;
  gap: 5px;
  padding: 15px 17px;
  border: 1px solid #d8dff1;
  border-radius: 16px;
  background: #f0efff;
}

.qh-image-cost small,
.qh-balance-line span {
  color: #52617b;
  font-size: 12px;
}

.qh-image-cost strong,
.qh-balance-line strong {
  color: #1c2c54;
  font-size: 20px;
}

.qh-image-cost em,
.qh-balance-line em {
  color: #374968;
  font-size: 13px;
  font-style: normal;
}

.qh-image-body {
  margin-top: 21px;
  padding: 0;
  border: 0;
  box-shadow: none;
}

.qh-image-body h4 {
  font-size: 20px;
}

.qh-balance-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin: 18px 0 14px;
  padding: 12px 15px;
  border: 1px solid #dfe6f2;
  border-radius: 12px;
  background: #f8fbff;
}

.qh-balance-line span:nth-of-type(2) {
  margin-left: auto;
}

.qh-invite {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid #cae2f5;
  border-radius: 12px;
  color: #294465;
  background: #edf8ff;
  text-align: left;
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  cursor: pointer;
}

.qh-invite b {
  display: inline-block;
  margin-left: 8px;
  color: #1868a9;
}

.qh-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 17px 22px;
  margin-top: 22px;
}

.qh-control {
  min-width: 0;
}

.qh-control > label,
.qh-prompt-label {
  display: block;
  margin-bottom: 8px;
  color: #233653;
  font-size: 13px;
  font-weight: 700;
}

.qh-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.qh-option {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #ced9e9;
  border-radius: 9px;
  color: #344866;
  background: #fff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}

.qh-option:hover,
.qh-option.is-active {
  border-color: #526de5;
  color: #243a9b;
  background: #edf0ff;
}

.qh-model-field {
  grid-column: 1 / -1;
}

.qh-model-field .qh-choice-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.qh-model-field .qh-option {
  min-height: 48px;
  text-align: center;
}

.qh-tip {
  grid-column: 1 / -1;
  padding: 10px 13px;
  border-left: 3px solid #4da7c4;
  color: #426078;
  background: #f2fbfd;
  font-size: 13px;
  line-height: 1.65;
}

.qh-style-control select,
.qh-history-tools input {
  width: 100%;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid #ced9e9;
  border-radius: 9px;
  color: #2a3c58;
  background: #fff;
  font: inherit;
}

.qh-upload {
  display: grid;
  justify-items: center;
  gap: 5px;
  margin-top: 23px;
  padding: 25px 18px;
  border: 1px dashed #9db3d2;
  border-radius: 14px;
  color: #334c6b;
  background: #fbfdff;
  text-align: center;
  cursor: pointer;
}

.qh-upload input {
  display: none;
}

.qh-upload-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid #b8c9df;
  border-radius: 50%;
  color: #4265c6;
  font-size: 22px;
}

.qh-upload strong {
  color: #273e62;
  font-size: 14px;
}

.qh-upload small,
.qh-upload em {
  color: #5e708b;
  font-size: 12px;
  font-style: normal;
  line-height: 1.55;
}

.qh-prompt-label {
  margin-top: 22px;
}

.qh-image-body textarea {
  width: 100%;
  min-height: 125px;
  resize: vertical;
  padding: 13px;
  border: 1px solid #cbd7e7;
  border-radius: 12px;
  color: #21324d;
  background: #fff;
  font: inherit;
  line-height: 1.65;
}

.qh-image-body textarea::placeholder,
.qh-history-tools input::placeholder {
  color: #73829a;
  opacity: 1;
}

.qh-actions {
  display: block;
  margin-top: 14px;
}

.qh-actions .generate-button {
  display: block;
  width: 100%;
  min-width: 0;
  min-height: 54px;
  border: 0;
  border-radius: 11px;
  color: #fff;
  background: linear-gradient(100deg, #176cc9 0%, #31b3f1 100%);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.qh-actions .cost-inline {
  color: #3b4d6c;
  font-size: 13px;
}

.qh-action-note {
  margin-top: 10px;
  color: #5b6d86;
  font-size: 12px;
  line-height: 1.6;
}

.qh-compat {
  display: none;
}

.qh-history {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid #e5ebf4;
}

.qh-history-heading,
.qh-history-tools,
.qh-history-range,
.qh-history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qh-history-heading {
  justify-content: space-between;
  gap: 16px;
}

.qh-history-heading > div:first-child {
  display: grid;
  gap: 4px;
}

.qh-history-heading strong {
  color: #1c2d4b;
  font-size: 18px;
}

.qh-history-heading small {
  color: #687a92;
  font-size: 12px;
}

.qh-history-range button,
.qh-history-tools button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid #ced9e9;
  border-radius: 8px;
  color: #3b4e6c;
  background: #fff;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

.qh-history-range button.is-active {
  border-color: #526de5;
  color: #2941a6;
  background: #edf0ff;
}

.qh-history-tools {
  margin-top: 14px;
}

.qh-history-tools input {
  flex: 1;
}

.qh-history-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.qh-history-card {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e1e8f2;
  border-radius: 12px;
  background: #fbfdff;
}

.qh-history-thumb {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  color: #4364ca;
  background: #edf0ff;
  font-size: 12px;
  font-weight: 700;
}

.qh-history-detail {
  min-width: 0;
}

.qh-history-detail h4,
.qh-history-detail p,
.qh-history-detail small {
  display: block;
  overflow: hidden;
  margin: 0;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.qh-history-detail h4 {
  color: #263b5c;
  font-size: 13px;
}

.qh-history-detail p {
  margin-top: 4px;
  color: #4e607b;
  font-size: 12px;
}

.qh-history-detail small {
  margin-top: 5px;
  color: #75849a;
  font-size: 11px;
}

.qh-history-actions {
  justify-content: flex-end;
  flex-wrap: wrap;
}

.qh-history-actions button,
.qh-history-actions a {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid #ced9e9;
  border-radius: 7px;
  color: #405572;
  background: #fff;
  font: inherit;
  font-size: 11px;
  text-decoration: none;
  cursor: pointer;
}

.qh-history-actions .delete-button {
  border-color: #ecd1d1;
  color: #a24747;
}

.qh-history-actions button:disabled {
  cursor: not-allowed;
  opacity: .65;
}

.qh-empty {
  padding: 23px 10px;
  color: #718198;
  font-size: 13px;
  text-align: center;
}

@media (max-width: 760px) {
  .qh-image-region { padding: 17px; border-radius: 14px; }
  .qh-image-intro { grid-template-columns: 1fr; }
  .qh-controls { grid-template-columns: 1fr; }
  .qh-model-field, .qh-tip { grid-column: auto; }
  .qh-model-field .qh-choice-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .qh-history-heading { align-items: flex-start; flex-direction: column; }
  .qh-history-card { grid-template-columns: 40px minmax(0, 1fr); }
  .qh-history-thumb { width: 40px; height: 40px; }
  .qh-history-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* Match the reference page's uploaded and completed-result states. */
.qh-image-intro {
  display: block;
}

.qh-body-cost {
  display: flex;
  justify-content: flex-end;
  margin: 14px 0 16px;
}

.qh-body-cost,
.qh-body-cost .qh-image-cost {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.qh-body-cost .qh-image-cost {
  width: min(248px, 100%);
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.qh-body-cost .qh-image-cost > * {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal !important;
}

.qh-body-cost .qh-image-cost em {
  line-height: 1.5;
}

.qh-reference-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 9px;
}

.qh-reference-item {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 72px;
  padding: 5px 5px 7px;
  border: 1px solid #d8e3f2;
  border-radius: 10px;
  background: #f8fbff;
}

.qh-reference-item button[aria-label^="参考图"] {
  width: 60px;
  height: 60px;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 7px;
  background: #eef3fb;
}

.qh-reference-item img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qh-reference-item span {
  color: #405572;
  font-size: 11px;
}

.qh-reference-item [data-qh-remove-reference] {
  position: absolute;
  top: -8px;
  right: -7px;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #555;
  font-size: 16px;
  line-height: 22px;
  cursor: pointer;
}

.qh-progress {
  margin-top: 9px;
  padding: 15px;
  border: 1px solid #dce5f1;
  border-radius: 14px;
  background: #fff;
}

.qh-progress strong,
.qh-progress span {
  display: inline-block;
  color: #263c5b;
  font-size: 13px;
}

.qh-progress span {
  float: right;
  color: #62738c;
  font-size: 12px;
}

.qh-progress > div {
  clear: both;
  height: 7px;
  margin-top: 13px;
  overflow: hidden;
  border-radius: 99px;
  background: #edf2f8;
}

.qh-progress i {
  display: block;
  width: 12%;
  height: 100%;
  border-radius: inherit;
  background: #2d94dc;
}

.qh-history-list {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 14px;
}

.qh-history-card {
  display: grid;
  grid-template-columns: 1fr auto;
  width: 224px;
  gap: 7px 10px;
  padding: 0 13px 12px;
  border: 1px solid #d8e3f2;
  border-radius: 14px;
  background: #fff;
}

.qh-result-image {
  display: grid;
  grid-column: 1 / -1;
  place-items: center;
  width: calc(100% + 26px);
  height: 176px;
  margin-left: -13px;
  overflow: hidden;
  border: 0;
  border-radius: 13px 13px 0 0;
  background: #111;
  cursor: pointer;
}

.qh-result-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.qh-result-image span {
  color: #aebbd0;
  font-size: 22px;
  font-weight: 700;
}

.qh-result-prompt {
  grid-column: 1 / -1;
  overflow: hidden;
  padding: 4px 0;
  border: 0;
  color: #263d5e;
  background: transparent;
  font: inherit;
  font-size: 13px;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.qh-result-meta,
.qh-result-cost,
.qh-history-card time {
  color: #a7afc0;
  font-size: 11px;
}

.qh-result-meta {
  display: flex;
  gap: 18px;
}

.qh-result-cost {
  grid-column: 1 / -1;
  justify-self: start;
  padding: 3px 8px;
  border: 1px solid #9ed5ff;
  border-radius: 99px;
  color: #2999e7;
}

.qh-history-card time {
  align-self: end;
}

.qh-result-delete {
  justify-self: end;
  padding: 0;
  border: 0;
  color: #ff7373;
  background: transparent;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
}

/* The reference upload state keeps the dropzone clean above the thumbnail. */
.qh-upload-icon {
  display: none;
}

/* Match Tool 09's top balance text to its normal inline cost font. */
.ai-page[data-qh-tool="motion"] .agent-panel-top .qh-wallet-balance,
.ai-page[data-qh-tool="motion"] .agent-panel-top .qh-wallet-balance * {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif !important;
  font-style: normal !important;
}
