:root {
  color-scheme: light;
  font-family:
    Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
  background: #f6f7f9;
  color: #1f2933;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
}

button,
textarea,
input {
  font: inherit;
}

.app {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(360px, 1.1fr);
  gap: 20px;
  align-items: start;
}

.upload-pane,
.result-pane {
  background: #ffffff;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 16px 38px rgba(31, 41, 51, 0.08);
}

.title-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 26px;
  line-height: 1.2;
}

h2 {
  font-size: 20px;
}

p {
  margin-top: 8px;
  color: #607080;
  line-height: 1.6;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 220px;
  padding: 24px;
  border: 2px dashed #9aaabd;
  border-radius: 8px;
  background: #fbfcfd;
  text-align: center;
  cursor: pointer;
  transition:
    border-color 0.18s ease,
    background 0.18s ease;
}

.drop-zone:hover,
.drop-zone.dragging {
  border-color: #146c94;
  background: #eef8fb;
}

.drop-zone input {
  display: none;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 10px;
  border-radius: 50%;
  background: #146c94;
  color: white;
  font-size: 30px;
  line-height: 1;
}

.drop-zone small {
  margin-top: 8px;
  color: #718091;
}

.preview-shell {
  margin-top: 16px;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  overflow: hidden;
  background: #eef2f5;
}

.preview-shell img {
  display: block;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
}

.primary-button,
.ghost-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  margin-top: 16px;
  background: #146c94;
  color: white;
  font-weight: 700;
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ghost-button {
  min-width: 72px;
  min-height: 36px;
  border: 1px solid #b8c4d0;
  background: #ffffff;
  color: #1f2933;
}

.status {
  min-height: 24px;
  margin-bottom: 10px;
  color: #607080;
}

.status.error {
  color: #b42318;
}

textarea {
  width: 100%;
  min-height: 330px;
  resize: vertical;
  border: 1px solid #c8d2dc;
  border-radius: 8px;
  padding: 14px;
  line-height: 1.7;
  color: #1f2933;
  background: #fbfcfd;
}

.hint-box {
  margin-top: 14px;
  border: 1px solid #d9e1e8;
  border-radius: 8px;
  padding: 12px 14px;
  background: #fbfcfd;
}

summary {
  cursor: pointer;
  color: #405060;
}

pre {
  overflow: auto;
  margin: 12px 0 0;
  white-space: pre-wrap;
  line-height: 1.5;
}

@media (max-width: 820px) {
  .app {
    width: min(100vw - 24px, 680px);
    padding: 18px 0;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .upload-pane,
  .result-pane {
    padding: 18px;
  }
}
