:root {
  --bg: #f4efe7;
  --bg-accent: #fff8ef;
  --ink: #1f2b38;
  --muted: #617184;
  --line: rgba(31, 43, 56, 0.12);
  --brand: #b21f2d;
  --brand-deep: #7f1620;
  --brand-soft: rgba(178, 31, 45, 0.12);
  --panel: rgba(255, 255, 255, 0.86);
  --shadow: 0 24px 60px rgba(31, 43, 56, 0.12);
  --ok: #1d7a50;
  --warn: #9a6a00;
  --err: #8e1f28;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(circle at top right, rgba(255, 223, 189, 0.75), transparent 28%),
    linear-gradient(180deg, var(--bg-accent), var(--bg));
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 72px;
}

.hero {
  padding: 12px 4px 28px;
}

.hero-kicker {
  margin-bottom: 12px;
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.02;
}

.hero-copy {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.7;
}

.panel {
  margin-top: 24px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.section-title h2 {
  margin: 0;
  font-size: 24px;
}

.step-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 13px;
  font-weight: 700;
}

.query-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 10px;
}

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

.field input {
  width: 100%;
  padding: 15px 16px;
  border: 1px solid rgba(31, 43, 56, 0.16);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-size: 16px;
}

.field input:focus {
  outline: none;
  border-color: rgba(178, 31, 45, 0.45);
  box-shadow: 0 0 0 4px rgba(178, 31, 45, 0.12);
}

.field input:disabled {
  background: rgba(236, 239, 242, 0.9);
  color: #8391a1;
}

.captcha-card {
  padding: 20px;
  border: 1px solid rgba(31, 43, 56, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 244, 236, 0.96));
}

.captcha-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 16px;
}

.captcha-title {
  font-size: 18px;
  font-weight: 700;
}

.captcha-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.captcha-body {
  display: grid;
  grid-template-columns: minmax(220px, 280px) 1fr;
  gap: 18px;
  margin-top: 18px;
}

.captcha-preview,
.preview-frame {
  position: relative;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(31, 43, 56, 0.2);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.captcha-preview {
  min-height: 152px;
}

.captcha-preview img {
  max-width: 100%;
  display: block;
}

.field-captcha {
  align-content: center;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 18px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  transition: transform 0.18s ease, opacity 0.18s ease, background 0.18s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  transform: none;
}

.button-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
  color: #fff;
}

.button-secondary {
  background: rgba(255, 255, 255, 0.96);
  color: var(--ink);
  border: 1px solid rgba(31, 43, 56, 0.12);
}

.status-banner {
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(31, 43, 56, 0.06);
  color: var(--ink);
  font-weight: 700;
}

.status-idle {
  background: rgba(31, 43, 56, 0.06);
}

.status-loading {
  background: rgba(178, 31, 45, 0.1);
  color: var(--brand-deep);
}

.status-found {
  background: rgba(29, 122, 80, 0.12);
  color: var(--ok);
}

.status-not_found,
.status-captcha_error {
  background: rgba(154, 106, 0, 0.14);
  color: var(--warn);
}

.status-error {
  background: rgba(142, 31, 40, 0.14);
  color: var(--err);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.meta-card {
  min-height: 180px;
  padding: 18px;
  border: 1px solid rgba(31, 43, 56, 0.08);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
}

.meta-label {
  margin-bottom: 14px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.message-list {
  margin: 0;
  padding-left: 18px;
  line-height: 1.7;
}

.field-list {
  margin: 0;
}

.field-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(31, 43, 56, 0.08);
}

.field-row:last-child {
  border-bottom: 0;
}

.field-term {
  color: var(--muted);
  font-weight: 700;
}

.empty-field {
  color: var(--muted);
}

.preview-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  margin-bottom: 18px;
}

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

.preview-frame {
  min-height: 360px;
  padding: 18px;
}

.preview-frame img {
  width: 100%;
  display: block;
  border-radius: 16px;
  box-shadow: 0 18px 50px rgba(31, 43, 56, 0.12);
}

.is-empty::before {
  content: "等待内容";
  color: #8b96a4;
  font-size: 14px;
}

.is-empty img {
  display: none;
}

.is-hidden {
  display: none;
}

@media (max-width: 900px) {
  .shell {
    width: min(100% - 20px, 1120px);
    padding-top: 24px;
  }

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

  .captcha-body,
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .preview-toolbar,
  .captcha-header,
  .section-title {
    flex-direction: column;
    align-items: stretch;
  }
}
