:root {
  --ua-ink: #17212f;
  --ua-muted: #788497;
  --ua-line: #e5e9f0;
  --ua-panel: #fff;
  --ua-primary: #ff5d43;
  --ua-shadow: 0 12px 32px rgba(28, 41, 61, 0.07);
}

.user-app-host {
  min-height: 100%;
  color: var(--ua-ink);
  font-family: "PingFang SC", "Microsoft YaHei", ui-sans-serif, system-ui, sans-serif;
}

.user-app-host *,
.user-app-host *::before,
.user-app-host *::after {
  box-sizing: border-box;
}

.user-app {
  min-height: 100vh;
  padding: 28px clamp(18px, 4vw, 68px) 56px;
  background:
    radial-gradient(circle at 98% 0%, rgba(255, 157, 121, 0.17), transparent 24rem),
    radial-gradient(circle at 0% 47%, rgba(110, 148, 245, 0.09), transparent 29rem),
    #f7f8fb;
}

.user-app__topbar,
.user-app__brand,
.user-app__account,
.user-app__field-label,
.user-app__preview-label,
.user-app__job-head,
.user-app__results-head,
.user-app__result-title,
.user-app__channel-card,
.user-app__access-actions,
.user-app__preview-dialog-head,
.user-app__preview-dialog-actions {
  display: flex;
  align-items: center;
}

.user-app__topbar {
  justify-content: space-between;
  gap: 20px;
  width: min(1240px, 100%);
  margin: 0 auto 25px;
}

.user-app__brand { gap: 12px; }

.user-app__brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  color: #fff;
  font-size: 19px;
  font-weight: 800;
  place-items: center;
  border-radius: 13px;
  background: linear-gradient(145deg, #ff8d55, var(--ua-primary));
  box-shadow: 0 8px 18px rgba(255, 93, 67, 0.25);
}

.user-app h1,
.user-app h2,
.user-app p,
.user-app pre { margin: 0; }

.user-app h1 {
  font-size: clamp(21px, 2.4vw, 28px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.user-app__eyebrow {
  margin-bottom: 4px !important;
  color: #9da6b5;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.user-app__account {
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.user-app__account-name {
  max-width: 170px;
  overflow: hidden;
  color: #647082;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-app__access-badge,
.user-app__status-pill,
.user-app__result-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  width: max-content;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  border-radius: 999px;
}

.user-app__access-badge {
  padding: 8px 10px;
  color: #687588;
  background: #eef1f5;
}

.user-app__access-badge.is-active { color: #16845a; background: #e2f7ed; }
.user-app__access-badge.is-locked { color: #b9681b; background: #fff1df; }

.user-app__access-badge.is-loading::before,
.user-app__status-pill.is-running::before,
.user-app__status-pill.is-pending::before {
  width: 7px;
  height: 7px;
  content: "";
  border-radius: 50%;
  background: currentColor;
  animation: user-app-pulse 1.1s infinite ease-in-out;
}

.user-app__notice {
  width: min(1240px, 100%);
  margin: -8px auto 17px;
  padding: 11px 14px;
  color: #a94334;
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid #ffd5ce;
  border-radius: 11px;
  background: #fff4f1;
}

.user-app__notice.is-success { color: #197956; border-color: #c2eddb; background: #effbf5; }

.user-app__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(340px, 0.97fr);
  gap: 18px;
  width: min(1240px, 100%);
  margin: 0 auto;
}

.user-app__panel,
.user-app__results {
  min-width: 0;
  border: 1px solid rgba(218, 224, 234, 0.87);
  border-radius: 18px;
  background: var(--ua-panel);
  box-shadow: var(--ua-shadow);
}

.user-app__panel { padding: clamp(19px, 2.5vw, 28px); }

.user-app__entry-panel {
  grid-row: span 2;
  display: flex;
  min-height: 480px;
  flex-direction: column;
}

.user-app__section-head h2,
.user-app__results-head h2,
.user-app__job-head h2 { font-size: 17px; letter-spacing: -0.02em; }

.user-app__section-head p,
.user-app__results-head p {
  margin-top: 7px;
  color: var(--ua-muted);
  font-size: 13px;
  line-height: 1.55;
}

.user-app__section-head--inline {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 17px;
}

.user-app__section-head--inline p { margin-top: 0; text-align: right; }

.user-app__textarea-wrap {
  position: relative;
  display: flex;
  flex: 1;
  min-height: 340px;
  margin-top: 20px;
}

.user-app__raw-input,
.user-app__field-input {
  width: 100%;
  outline: none;
  color: var(--ua-ink);
  font: inherit;
  border: 1px solid var(--ua-line);
  border-radius: 12px;
  background: #fbfcfe;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.user-app__raw-input:focus,
.user-app__field-input:focus {
  border-color: #ff9d8d;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(255, 93, 67, 0.1);
}

.user-app__raw-input {
  min-height: 340px;
  resize: vertical;
  padding: 17px 17px 46px;
  font-size: 14px;
  line-height: 1.85;
}

.user-app__raw-input::placeholder,
.user-app__field-input::placeholder { color: #b4bdca; }

.user-app__input-tools {
  position: absolute;
  right: 12px;
  bottom: 11px;
  left: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  pointer-events: none;
}

.user-app__parse-hint {
  overflow: hidden;
  color: #8a95a5;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-app__text-button,
.user-app__small-button,
.user-app__mini-button,
.user-app__dialog-close {
  cursor: pointer;
  font: inherit;
  border: 0;
  transition: transform 150ms ease, background 150ms ease, color 150ms ease;
}

.user-app__text-button {
  padding: 5px 6px;
  color: #7d8999;
  font-size: 12px;
  background: transparent;
  pointer-events: auto;
}

.user-app__text-button:hover { color: var(--ua-primary); }

.user-app__fields {
  display: grid;
  gap: 14px;
  margin-top: 21px;
}

.user-app__field { display: grid; gap: 7px; }

.user-app__field-label {
  gap: 7px;
  color: #5f6b7b;
  font-size: 12px;
  font-weight: 700;
}

.user-app__field-icon {
  display: grid;
  width: 18px;
  height: 18px;
  color: #ff795e;
  font-size: 10px;
  font-style: normal;
  place-items: center;
  border-radius: 5px;
  background: #fff0ed;
}

.user-app__field-input {
  min-height: 43px;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.45;
  resize: vertical;
}

.user-app__field--address .user-app__field-input { min-height: 74px; }

.user-app__format-preview {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed #d8dee8;
  border-radius: 12px;
  background: #fbfcfe;
}

.user-app__preview-label {
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
  color: #647083;
  font-size: 12px;
  font-weight: 700;
}

.user-app__preview-label small { color: #a1aab8; font-size: 11px; font-weight: 400; }

.user-app__preview-text {
  overflow: auto;
  min-height: 44px;
  color: #243043;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.user-app__preview-text.is-empty { color: #abb4c1; }

.user-app__channel-panel { grid-column: 1 / -1; }

.user-app__channel-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(205px, 1fr));
  gap: 13px;
}

.user-app__channel-card {
  position: relative;
  gap: 11px;
  min-width: 0;
  min-height: 82px;
  padding: 9px;
  text-align: left;
  cursor: pointer;
  border: 1px solid #e4e8ef;
  border-radius: 12px;
  background: #fff;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.user-app__channel-card:hover {
  transform: translateY(-2px);
  border-color: #f3b2a6;
  box-shadow: 0 8px 18px rgba(36, 48, 67, 0.08);
}

.user-app__channel-card.is-selected {
  border-color: var(--ua-primary);
  box-shadow: 0 0 0 3px rgba(255, 93, 67, 0.1);
}

.user-app__channel-visual {
  display: grid;
  flex: 0 0 65px;
  width: 65px;
  height: 62px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: #eff2f7;
}

.user-app__channel-visual img { width: 100%; height: 100%; object-fit: cover; }

.user-app__channel-visual.is-image-missing {
  color: #8895a8;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.6) 25%, transparent 25%) 0 0 / 12px 12px,
    #e7ebf2;
}

.user-app__image-placeholder {
  padding: 5px;
  color: #8d99aa;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #ccd3df;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.55);
}

.user-app__channel-info { display: grid; min-width: 0; gap: 5px; }
.user-app__channel-info strong,
.user-app__channel-info small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-app__channel-info strong { color: #2e3a4c; font-size: 13px; }
.user-app__channel-info small { color: #939dac; font-size: 11px; }

.user-app__channel-check {
  position: absolute;
  top: 7px;
  right: 7px;
  display: none;
  width: 18px;
  height: 18px;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  line-height: 18px;
  text-align: center;
  border-radius: 50%;
  background: var(--ua-primary);
}

.user-app__channel-card.is-selected .user-app__channel-check { display: block; }

.user-app__channel-skeleton {
  height: 82px;
  border-radius: 12px;
  background: linear-gradient(105deg, #f0f2f6 25%, #f8f9fb 38%, #f0f2f6 63%);
  background-size: 250% 100%;
  animation: user-app-shimmer 1.25s linear infinite;
}

.user-app__action-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 21px;
  grid-column: 1 / -1;
  padding-block: 19px;
  background: linear-gradient(100deg, rgba(255, 246, 243, 0.92), rgba(255, 255, 255, 0.98) 45%), #fff;
}

.user-app__access-box { flex: 1; min-width: 0; }
.user-app__access-copy { display: grid; gap: 6px; }
.user-app__access-copy strong { font-size: 14px; }
.user-app__access-copy span,
.user-app__access-loading { color: #7d8999; font-size: 12px; line-height: 1.5; }

.user-app__access-actions { flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.user-app__small-button,
.user-app__mini-button {
  padding: 8px 11px;
  color: #c34b3a;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid #ffc8be;
  border-radius: 8px;
  background: #fff8f6;
}

.user-app__small-button.is-secondary {
  color: #627083;
  border-color: #d9e0ea;
  background: #fff;
}

.user-app__action-copy { display: grid; justify-items: end; gap: 9px; }

.user-app__generate-button {
  min-width: 174px;
  min-height: 47px;
  padding: 12px 19px;
  cursor: pointer;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #ff8267, var(--ua-primary));
  box-shadow: 0 8px 15px rgba(255, 93, 67, 0.22);
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.user-app__generate-button:hover:not(:disabled),
.user-app__small-button:hover,
.user-app__mini-button:hover,
.user-app__dialog-close:hover { transform: translateY(-1px); }

.user-app__generate-button:hover:not(:disabled) {
  box-shadow: 0 11px 22px rgba(255, 93, 67, 0.31);
}

.user-app__generate-button:disabled { cursor: not-allowed; opacity: 0.48; box-shadow: none; }
.user-app__generate-subtext { color: #8b96a6; font-size: 11px; }

.user-app__job-panel {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: 178px 1fr;
  gap: 24px;
  align-items: center;
}

.user-app__job-head { justify-content: space-between; gap: 12px; }

.user-app__status-pill {
  padding: 7px 9px;
  color: #8190a1;
  background: #f0f2f5;
}

.user-app__status-pill.is-pending { color: #b46a27; background: #fff1df; }
.user-app__status-pill.is-running { color: #3677ca; background: #eaf3ff; }
.user-app__status-pill.is-success,
.user-app__result-status.is-success { color: #16845a; background: #e3f7ed; }
.user-app__status-pill.is-error,
.user-app__result-status.is-error { color: #c3493a; background: #fff0ed; }

.user-app__job-body { min-width: 0; }
.user-app__job-summary { color: #596779; font-size: 13px; line-height: 1.55; }

.user-app__progress {
  height: 7px;
  margin: 12px 0 8px;
  overflow: hidden;
  border-radius: 9px;
  background: #edf0f4;
}

.user-app__progress-bar {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff9c78, var(--ua-primary));
  transition: width 320ms ease;
}

.user-app__progress.is-active .user-app__progress-bar {
  background-size: 200% 100%;
  animation: user-app-progress 1.7s linear infinite;
}

.user-app__job-meta {
  overflow: hidden;
  color: #9aa4b2;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-app__results {
  grid-column: 1 / -1;
  padding: clamp(19px, 2.5vw, 28px);
}

.user-app__results-head { justify-content: space-between; gap: 16px; margin-bottom: 17px; }
.user-app__results-head > div { min-width: 0; }
.user-app__results-list { display: grid; gap: 10px; }

.user-app__result-item {
  display: grid;
  grid-template-columns: 79px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 10px;
  border: 1px solid #e9ecf1;
  border-radius: 12px;
  background: #fff;
}

.user-app__result-thumb {
  display: grid;
  width: 79px;
  height: 61px;
  overflow: hidden;
  place-items: center;
  border-radius: 8px;
  background: #edf0f5;
}

.user-app__result-thumb img { width: 100%; height: 100%; object-fit: cover; }

.user-app__result-thumb.is-missing {
  padding: 8px;
  color: #8f9aac;
  font-size: 11px;
  text-align: center;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.68) 25%, transparent 25%) 0 0 / 12px 12px,
    #e9edf3;
}

.user-app__result-details { min-width: 0; }
.user-app__result-title { gap: 9px; min-width: 0; }
.user-app__result-title strong,
.user-app__result-details p {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.user-app__result-title strong { color: #364254; font-size: 13px; }

.user-app__result-status {
  padding: 4px 6px;
  color: #9aa3b0;
  font-size: 10px;
  background: #f0f2f5;
}
.user-app__result-status.is-pending { color: #b46a27; background: #fff1df; }
.user-app__result-status.is-running { color: #3677ca; background: #eaf3ff; }
.user-app__result-details p { margin-top: 7px; color: #8c96a5; font-size: 12px; }

.user-app__result-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.user-app__mini-button {
  padding: 7px 9px;
  color: #687689;
  font-weight: 600;
  border-color: #dce2ea;
  background: #fff;
}

.user-app__mini-button.is-primary {
  color: #fff;
  border-color: var(--ua-primary);
  background: var(--ua-primary);
}

.user-app__mini-button.is-danger {
  color: #c94c43;
  border-color: #f0d2cf;
  background: #fff8f7;
}

.user-app__mini-button.is-danger:hover:not(:disabled) {
  color: #fff;
  border-color: #d65b51;
  background: #d65b51;
}

.user-app__empty {
  display: grid;
  min-height: 98px;
  padding: 22px;
  color: #9aa4b3;
  font-size: 13px;
  text-align: center;
  place-items: center;
  border: 1px dashed #dde3eb;
  border-radius: 12px;
  background: #fbfcfd;
}

.user-app__empty strong { color: #748195; font-size: 14px; }
.user-app__empty span { margin-top: 5px; font-size: 12px; }
.user-app__empty--channels { grid-column: 1 / -1; }

.user-app__preview-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  padding: 20px;
  place-items: center;
  background: rgba(21, 29, 43, 0.62);
  backdrop-filter: blur(3px);
}

.user-app__preview-dialog {
  display: grid;
  width: min(980px, 100%);
  max-height: min(820px, 92vh);
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.28);
}

.user-app__preview-dialog-head {
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid #e8ebf0;
}

.user-app__preview-dialog-head strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-app__dialog-close {
  padding: 6px 8px;
  color: #748094;
  font-size: 12px;
  border-radius: 7px;
  background: #f3f5f8;
}

.user-app__preview-dialog-body {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 294px;
  overflow: hidden;
}

.user-app__preview-image-wrap {
  min-width: 0;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: auto;
  background: #f3f5f8;
}

.user-app__preview-image-wrap > img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 118px);
  object-fit: contain;
}

.user-app__preview-tutorial {
  min-width: 0;
  overflow-y: auto;
  padding: 24px 20px;
  border-left: 1px solid #e8ebf0;
  background: #fff;
}

.user-app__preview-tutorial-kicker {
  display: inline-flex;
  padding: 4px 7px;
  color: #087949;
  font-size: 10px;
  font-weight: 700;
  border-radius: 999px;
  background: #e8f8f0;
}

.user-app__preview-tutorial h3 {
  margin-top: 9px;
  color: #263445;
  font-size: 17px;
}

.user-app__preview-tutorial ol {
  display: grid;
  gap: 17px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}

.user-app__preview-tutorial li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.user-app__preview-tutorial li > i {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  color: #fff;
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  border-radius: 8px;
  background: #0aaf6f;
  box-shadow: 0 5px 12px rgba(10, 175, 111, 0.18);
}

.user-app__preview-tutorial li > span {
  display: grid;
  gap: 4px;
}

.user-app__preview-tutorial li strong {
  color: #354254;
  font-size: 12px;
}

.user-app__preview-tutorial li small {
  color: #7f8a99;
  font-size: 11px;
  line-height: 1.55;
}

.user-app__preview-dialog-actions {
  justify-content: flex-end;
  padding: 12px 16px;
  border-top: 1px solid #e8ebf0;
}

@keyframes user-app-pulse {
  50% { opacity: 0.35; transform: scale(0.72); }
}

@keyframes user-app-shimmer {
  to { background-position: -250% 0; }
}

@keyframes user-app-progress {
  to { background-position: 200% 0; }
}

@media (max-width: 780px) {
  .user-app { padding: 18px 14px 36px; }
  .user-app__topbar { align-items: flex-start; margin-bottom: 19px; }
  .user-app__account { flex-direction: column; align-items: flex-end; gap: 6px; }
  .user-app__account-name { max-width: 120px; }
  .user-app__layout { grid-template-columns: 1fr; gap: 13px; }
  .user-app__entry-panel,
  .user-app__channel-panel,
  .user-app__action-panel,
  .user-app__job-panel,
  .user-app__results { grid-column: auto; grid-row: auto; }
  .user-app__entry-panel { min-height: 380px; }
  .user-app__textarea-wrap,
  .user-app__raw-input { min-height: 262px; }
  .user-app__section-head--inline { align-items: flex-start; flex-direction: column; }
  .user-app__section-head--inline p { text-align: left; }
  .user-app__channel-grid { grid-template-columns: 1fr; }
  .user-app__action-panel { align-items: stretch; flex-direction: column; }
  .user-app__action-copy { justify-items: stretch; }
  .user-app__generate-button { width: 100%; }
  .user-app__generate-subtext { text-align: center; }
  .user-app__job-panel { grid-template-columns: 1fr; gap: 15px; }
  .user-app__result-item { grid-template-columns: 64px minmax(0, 1fr); gap: 11px; }
  .user-app__result-thumb { width: 64px; height: 54px; }
  .user-app__result-actions { grid-column: 1 / -1; justify-content: stretch; }
  .user-app__result-actions .user-app__mini-button { flex: 1; }
}

@media (max-width: 430px) {
  .user-app__brand-mark { width: 37px; height: 37px; border-radius: 11px; }
  .user-app h1 { font-size: 20px; }
  .user-app__panel,
  .user-app__results { padding: 17px; border-radius: 14px; }
  .user-app__preview-label { align-items: flex-start; flex-direction: column; gap: 3px; }
  .user-app__access-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .user-app__small-button { width: 100%; }
}

/* 紧凑型桌面 / 手机双端布局 */
.user-app-host {
  min-width: 0;
}

.user-app {
  min-height: 0;
  padding: 0;
  color: #1d2733;
  background: transparent;
}

.user-app__topbar {
  min-height: 38px;
  margin: 0 0 10px;
  padding: 7px 11px;
  align-items: center;
  border: 1px solid #dfe9e4;
  border-radius: 11px;
  background: rgba(250, 255, 252, 0.9);
}

.user-app__workflow {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 8px;
  color: #7b8592;
  font-size: 11px;
}

.user-app__workflow strong {
  color: #087848;
  font-size: 12px;
}

.user-app__workflow i {
  color: #b6c2bb;
  font-style: normal;
}

.user-app__account {
  flex-direction: row;
  align-items: center;
}

.user-app__account-name {
  max-width: 180px;
  font-size: 11px;
}

.user-app__access-badge {
  padding: 4px 8px;
  font-size: 10px;
}

.user-app__notice {
  margin-bottom: 10px;
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12px;
}

.user-app__notice.is-info {
  color: #356b84;
  border-color: #cfe6f0;
  background: #f2fbff;
}

.user-app__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(340px, 0.82fr);
  gap: 11px;
}

.user-app__panel,
.user-app__results {
  padding: 15px;
  border: 1px solid #e2e6e9;
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 3px 12px rgba(25, 40, 52, 0.025);
}

.user-app__entry-panel,
.user-app__form-panel {
  min-height: 0;
}

.user-app__entry-panel {
  grid-column: 1;
  grid-row: 1;
}

.user-app__form-panel {
  grid-column: 2;
  grid-row: 1;
}

.user-app__channel-panel,
.user-app__action-panel,
.user-app__job-panel,
.user-app__results {
  grid-column: 1 / -1;
}

.user-app__section-head {
  margin-bottom: 10px;
}

.user-app__section-head h2,
.user-app__results-head h2,
.user-app__job-head h2 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 15px;
}

.user-app__entry-panel .user-app__section-head h2::before,
.user-app__form-panel .user-app__section-head h2::before,
.user-app__channel-panel .user-app__section-head h2::before {
  display: grid;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 7px;
  color: #087949;
  background: #dff7eb;
  font-size: 11px;
  font-weight: 800;
}

.user-app__entry-panel .user-app__section-head h2::before { content: "1"; }
.user-app__form-panel .user-app__section-head h2::before { content: "2"; }
.user-app__channel-panel .user-app__section-head h2::before { content: "3"; }

.user-app__section-head p,
.user-app__results-head p {
  margin-top: 4px;
  font-size: 11px;
}

.user-app__textarea-wrap,
.user-app__raw-input {
  min-height: 183px;
}

.user-app__textarea-wrap {
  border-color: #dbe2df;
  border-radius: 10px;
}

.user-app__textarea-wrap:focus-within {
  border-color: #22b874;
  box-shadow: 0 0 0 3px rgba(22, 184, 116, 0.1);
}

.user-app__raw-input {
  padding: 13px;
  font-size: 13px;
  line-height: 1.65;
}

.user-app__input-tools {
  min-height: 46px;
  padding: 7px 8px 7px 11px;
  gap: 8px;
}

.user-app__parse-hint {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 10px;
}

.user-app__input-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
}

.user-app__parse-button {
  min-height: 31px;
  padding: 0 10px;
  pointer-events: auto;
  border: 1px solid #0ba861;
  border-radius: 8px;
  color: #fff;
  background: #08ad63;
  font-size: 11px;
  font-weight: 800;
}

.user-app__parse-button.is-secondary {
  color: #087848;
  border-color: #c8e9d8;
  background: #effbf5;
}

.user-app__text-button {
  min-height: 29px;
  font-size: 11px;
}

.user-app__fields {
  gap: 8px;
}

.user-app__field {
  gap: 5px;
}

.user-app__field-label {
  font-size: 11px;
}

.user-app__field-input {
  min-height: 36px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 12px;
}

textarea.user-app__field-input {
  min-height: 58px;
}

.user-app__format-preview {
  margin-top: 9px;
  padding: 10px 11px;
  border-radius: 9px;
}

.user-app__preview-label {
  margin-bottom: 6px;
}

.user-app__preview-text {
  min-height: 42px;
  font-size: 12px;
  line-height: 1.55;
}

.user-app__channel-panel {
  padding-bottom: 13px;
}

.user-app__section-head--inline {
  align-items: center;
}

.user-app__channel-grid {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
}

.user-app__channel-card {
  position: relative;
  min-width: 0;
  min-height: 116px;
  padding: 7px;
  display: grid;
  grid-template-columns: 1fr;
  align-content: start;
  justify-items: center;
  gap: 6px;
  border-radius: 10px;
}

.user-app__channel-card.is-selected {
  border-color: #16b66e;
  background: #f0fbf5;
  box-shadow: inset 0 0 0 1px #16b66e;
}

.user-app__channel-visual {
  width: 100%;
  height: 68px;
  border-radius: 7px;
}

.user-app__channel-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-app__channel-info {
  width: 100%;
  text-align: center;
}

.user-app__channel-info strong {
  overflow: hidden;
  display: block;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.user-app__channel-info small {
  display: none;
}

.user-app__channel-check {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 20px;
  height: 20px;
}

.user-app__channel-skeleton {
  min-height: 116px;
}

.user-app__action-panel {
  min-height: 72px;
  padding: 11px 13px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  border-color: #ccebdc;
  background: linear-gradient(105deg, #f8fffb, #effbf5);
}

.user-app__access-box {
  min-width: 0;
}

.user-app__access-copy strong {
  font-size: 12px;
}

.user-app__access-copy span {
  font-size: 10px;
}

.user-app__action-copy {
  min-width: 230px;
}

.user-app__generate-button {
  min-height: 42px;
  padding: 0 22px;
  border-radius: 9px;
  background: #08ad63;
  box-shadow: 0 7px 17px rgba(7, 159, 89, 0.18);
  font-size: 14px;
}

.user-app__generate-button:hover:not(:disabled) {
  background: #078d52;
}

.user-app__generate-subtext {
  margin-top: 5px;
  font-size: 10px;
}

.user-app__job-panel {
  min-height: 0;
  padding: 12px 15px;
  grid-template-columns: minmax(150px, 0.3fr) minmax(0, 1fr);
  gap: 18px;
}

.user-app__job-head {
  align-items: center;
}

.user-app__job-body {
  gap: 6px;
}

.user-app__job-summary,
.user-app__job-meta {
  font-size: 10px;
}

.user-app__results {
  padding: 14px 15px;
}

.user-app__results-head {
  margin-bottom: 10px;
}

.user-app__results-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.user-app__empty {
  grid-column: 1 / -1;
  min-height: 90px;
}

.user-app__result-item {
  min-width: 0;
  padding: 8px;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 9px;
  border: 1px solid #e6e9ec;
  border-radius: 10px;
}

.user-app__result-thumb {
  width: 72px;
  height: 58px;
}

.user-app__result-details p {
  margin-top: 4px;
  font-size: 10px;
}

.user-app__result-title strong {
  font-size: 12px;
}

@media (max-width: 820px) {
  .user-app__layout {
    grid-template-columns: 1fr;
  }

  .user-app__entry-panel,
  .user-app__form-panel,
  .user-app__channel-panel,
  .user-app__action-panel,
  .user-app__job-panel,
  .user-app__results {
    grid-column: 1;
    grid-row: auto;
  }

  .user-app__results-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .user-app__topbar {
    min-height: 34px;
    padding: 6px 8px;
  }

  .user-app__workflow {
    gap: 5px;
  }

  .user-app__workflow strong,
  .user-app__workflow i,
  .user-app__account-name {
    display: none;
  }

  .user-app__workflow span {
    padding: 3px 6px;
    border-radius: 999px;
    background: #eef7f2;
    font-size: 10px;
  }

  .user-app__panel,
  .user-app__results {
    padding: 12px;
    border-radius: 11px;
  }

  .user-app__entry-panel {
    min-height: 0;
  }

  .user-app__textarea-wrap,
  .user-app__raw-input {
    min-height: 168px;
  }

  .user-app__input-tools {
    min-height: auto;
    padding: 7px;
    align-items: stretch;
    flex-direction: column;
  }

  .user-app__parse-hint {
    padding: 0 2px;
  }

  .user-app__input-actions {
    display: grid;
    grid-template-columns: auto 1fr 1.25fr;
  }

  .user-app__channel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .user-app__channel-card {
    min-height: 100px;
    padding: 5px;
  }

  .user-app__channel-visual {
    height: 58px;
  }

  .user-app__action-panel {
    position: static;
    padding: 9px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .user-app__access-box {
    display: none;
  }

  .user-app__action-copy {
    min-width: 0;
  }

  .user-app__generate-button {
    width: 100%;
  }

  .user-app__job-panel {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .user-app__result-item {
    grid-template-columns: 64px minmax(0, 1fr);
  }
}

@media (max-width: 380px) {
  .user-app__workflow span:nth-of-type(2) {
    display: none;
  }

  .user-app__channel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* 单屏紧凑操作台：首屏同时看到粘贴、渠道和生成 */
.user-app__topbar {
  display: none;
}

.user-app__layout {
  grid-template-columns: minmax(0, 1.16fr) minmax(350px, 0.84fr);
  gap: 9px;
}

.user-app__panel,
.user-app__results {
  padding: 12px;
  border-radius: 12px;
}

.user-app__entry-panel,
.user-app__form-panel {
  height: 242px;
  min-height: 0;
  overflow: hidden;
}

.user-app__section-head {
  margin-bottom: 7px;
}

.user-app__section-head p,
.user-app__results-head p {
  margin-top: 2px;
  line-height: 1.35;
}

.user-app__form-panel .user-app__section-head p {
  display: none;
}

.user-app__textarea-wrap {
  height: 175px;
  min-height: 0;
  margin-top: 7px;
  flex: none;
}

.user-app__raw-input {
  height: 100%;
  min-height: 0;
  padding: 11px 12px 49px;
  resize: none;
}

.user-app__fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px 8px;
  margin-top: 8px;
}

.user-app__field {
  gap: 4px;
}

.user-app__field-label {
  gap: 5px;
  font-size: 10px;
}

.user-app__field-icon {
  width: 16px;
  height: 16px;
  font-size: 9px;
}

.user-app__field-input {
  min-height: 30px;
  padding: 5px 8px;
}

textarea.user-app__field-input,
.user-app__field--address .user-app__field-input {
  min-height: 46px;
  height: 46px;
  resize: none;
}

.user-app__format-preview {
  margin-top: 6px;
  padding: 6px 8px;
}

.user-app__preview-label {
  margin-bottom: 3px;
}

.user-app__preview-text {
  min-height: 22px;
  max-height: 36px;
  font-size: 11px;
  line-height: 1.45;
}

.user-app__channel-panel {
  padding: 11px 12px 12px;
}

.user-app__channel-panel .user-app__section-head--inline {
  margin-bottom: 7px;
}

.user-app__channel-panel .user-app__section-head--inline p {
  font-size: 10px;
}

.user-app__channel-workspace {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-items: stretch;
}

.user-app__channel-grid {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: 104px;
  gap: 7px;
  min-width: 0;
  overflow-x: auto;
  min-height: 100px;
  height: 100px;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.user-app__channel-card {
  min-height: 94px;
  height: 94px;
  padding: 6px;
  gap: 4px;
}

.user-app__channel-visual {
  height: 52px;
}

.user-app__channel-skeleton {
  min-height: 94px;
  height: 94px;
}

.user-app__channel-workspace > .user-app__action-panel {
  grid-column: auto;
  min-height: 100px;
  padding: 9px;
  grid-template-columns: 1fr;
  gap: 7px;
  border-color: #ccebdc;
  border-radius: 10px;
  box-shadow: none;
}

.user-app__channel-workspace .user-app__access-copy {
  gap: 2px;
}

.user-app__action-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.user-app__action-status-label {
  color: #687689;
  font-size: 10px;
  font-weight: 700;
}

.user-app__action-status-value {
  padding: 3px 7px;
  color: #687689;
  font-size: 9px;
  line-height: 1.2;
  border-radius: 999px;
  background: #eef2f4;
}

.user-app__action-status-value.is-active {
  color: #087848;
  background: #dff7eb;
}

.user-app__action-status-value.is-locked {
  color: #a85e17;
  background: #fff0dc;
}

.user-app__action-status-value.is-loading {
  color: #3677ca;
  background: #eaf3ff;
}

.user-app__channel-workspace .user-app__access-copy strong {
  overflow: hidden;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-app__channel-workspace .user-app__access-copy span,
.user-app__channel-workspace .user-app__access-loading {
  overflow: hidden;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-app__channel-workspace .user-app__access-actions {
  margin-top: 5px;
  gap: 5px;
}

.user-app__channel-workspace .user-app__small-button {
  padding: 5px 8px;
  font-size: 10px;
}

.user-app__channel-workspace .user-app__action-copy {
  min-width: 0;
  width: 100%;
  justify-items: stretch;
  gap: 3px;
}

.user-app__channel-workspace .user-app__generate-button {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 0 12px;
  font-size: 13px;
}

.user-app__channel-workspace .user-app__generate-subtext {
  overflow: hidden;
  margin-top: 0;
  font-size: 9px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-app__job-panel[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .user-app__layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .user-app__entry-panel,
  .user-app__form-panel {
    height: auto;
    min-height: 0;
  }

  .user-app__textarea-wrap {
    height: 142px;
  }

  .user-app__channel-workspace {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .user-app__panel,
  .user-app__results {
    padding: 10px;
  }

  .user-app__section-head p {
    display: none;
  }

  .user-app__textarea-wrap,
  .user-app__raw-input {
    min-height: 112px;
    height: 112px;
  }

  .user-app__fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-top: 6px;
  }

  .user-app__channel-workspace {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .user-app__channel-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: visible;
    min-height: 82px;
    height: auto;
  }

  .user-app__channel-card,
  .user-app__channel-skeleton {
    min-height: 82px;
    height: 82px;
  }

  .user-app__channel-visual {
    height: 43px;
  }

  .user-app__channel-workspace > .user-app__action-panel {
    min-height: 104px;
    padding: 7px;
  }

  .user-app__channel-workspace .user-app__access-box {
    display: block;
  }

  .user-app__channel-workspace .user-app__access-copy {
    display: none;
  }
}

.user-app__dialog-close {
  display: grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  color: #526174;
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  border-radius: 50%;
  background: #f1f4f6;
}

.user-app__preview-dialog-actions {
  gap: 8px;
}

@media (max-width: 560px) {
  .user-app__preview-overlay {
    padding: 10px;
  }

  .user-app__preview-dialog {
    max-height: 94vh;
    border-radius: 13px;
  }

  .user-app__preview-dialog-head {
    padding: 10px 12px;
  }

  .user-app__preview-dialog-body {
    grid-template-columns: 1fr;
    overflow-y: auto;
  }

  .user-app__preview-image-wrap {
    min-height: 200px;
    overflow: visible;
  }

  .user-app__preview-image-wrap > img {
    max-height: 44vh;
  }

  .user-app__preview-tutorial {
    padding: 15px 14px;
    overflow: visible;
    border-top: 1px solid #e8ebf0;
    border-left: 0;
  }

  .user-app__preview-tutorial h3 {
    margin-top: 6px;
    font-size: 14px;
  }

  .user-app__preview-tutorial ol {
    gap: 10px;
    margin-top: 12px;
  }

  .user-app__preview-tutorial li {
    grid-template-columns: 23px minmax(0, 1fr);
    gap: 8px;
  }

  .user-app__preview-tutorial li > i {
    width: 23px;
    height: 23px;
  }

  .user-app__preview-dialog-actions {
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    padding: 10px;
  }

  .user-app__preview-dialog-actions .user-app__mini-button {
    width: 100%;
    min-height: 39px;
  }
}
