:root {
  --bg: #f5efe6;
  --panel: rgba(255, 252, 247, 0.92);
  --panel-border: rgba(116, 79, 36, 0.12);
  --text: #2f241b;
  --muted: #786554;
  --accent: #9f4f2d;
  --accent-strong: #7e3b20;
  --accent-soft: rgba(159, 79, 45, 0.12);
  --success: #2f6f4f;
  --shadow: 0 24px 80px rgba(79, 49, 26, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(222, 169, 122, 0.35), transparent 34%),
    linear-gradient(180deg, #f8f1e7 0%, #f2e7d7 100%);
  min-height: 100vh;
}

.page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.panel {
  width: min(100%, 760px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  padding: 28px;
  backdrop-filter: blur(14px);
}

.eyebrow {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

h1,
h2 {
  margin: 0;
}

h1 {
  margin-top: 14px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.08;
}

.intro {
  margin: 14px 0 24px;
  color: var(--muted);
  line-height: 1.6;
}

.dropzone {
  border: 2px dashed rgba(126, 59, 32, 0.25);
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(249, 235, 219, 0.92));
  min-height: 180px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 24px;
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.dropzone:hover,
.dropzone:focus,
.dropzone.dragover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 16px 40px rgba(126, 59, 32, 0.12);
  outline: none;
}

.dropzone-copy {
  display: grid;
  gap: 8px;
}

.dropzone-copy strong {
  font-size: 24px;
}

.dropzone-copy span,
.dropzone-copy small {
  color: var(--muted);
}

.preview-wrap {
  margin-top: 18px;
}

.preview {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  border-radius: 18px;
  border: 1px solid rgba(116, 79, 36, 0.14);
  background: #fff;
}

.image-meta {
  margin-top: 10px;
  color: var(--success);
  font-size: 14px;
}

.action {
  width: 100%;
  margin-top: 22px;
  border: 0;
  border-radius: 16px;
  padding: 16px 18px;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: #fff8f2;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 160ms ease, opacity 160ms ease;
}

.action:hover:not(:disabled) {
  transform: translateY(-1px);
}

.action:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.status {
  min-height: 24px;
  margin: 14px 2px 0;
  color: var(--muted);
}

.result-card {
  margin-top: 20px;
  border-radius: 20px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(116, 79, 36, 0.1);
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.latency {
  color: var(--muted);
  font-size: 14px;
}

.result-text {
  margin: 16px 0 0;
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.65;
  font-family: inherit;
}

.hidden {
  display: none;
}

@media (max-width: 640px) {
  .page {
    padding: 14px;
  }

  .panel {
    padding: 18px;
    border-radius: 22px;
  }

  .dropzone-copy strong {
    font-size: 20px;
  }

  .result-head {
    align-items: flex-start;
    flex-direction: column;
  }
}
