:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --card: #ffffff;
  --card-soft: #f8fafc;
  --text: #101828;
  --muted: #667085;
  --line: #e4e7ec;
  --line-strong: #d0d5dd;
  --primary: #111827;
  --primary-hover: #1f2937;
  --accent: #2563eb;
  --accent-soft: #eff6ff;
  --success: #087443;
  --success-bg: #ecfdf3;
  --warn: #b54708;
  --warn-bg: #fffaeb;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --shadow: 0 20px 64px rgba(16, 24, 40, 0.09);
  --soft-shadow: 0 8px 24px rgba(16, 24, 40, 0.07);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 15% 0%, rgba(37, 99, 235, 0.08), transparent 28%),
    linear-gradient(180deg, #fbfcff 0%, var(--bg) 100%);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
  min-width: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  overflow-wrap: anywhere;
}

a:hover {
  text-decoration: underline;
}

.page-shell {
  width: min(100% - 40px, 1060px);
  margin: 0 auto;
  padding: 28px 0 52px;
}

.query-shell {
  width: min(100% - 32px, 760px);
}

.hero {
  margin-bottom: 18px;
  text-align: center;
}

.compact-hero {
  margin-bottom: 18px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 850;
  line-height: 1.1;
  letter-spacing: 0;
}

.compact-hero h1 {
  font-size: clamp(32px, 4vw, 44px);
}

.hero-subtitle,
.helper-text {
  max-width: 720px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.58;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  width: min(100%, 620px);
  margin: 0 auto 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.76);
  padding: 6px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, 0.06);
}

.tab-button {
  min-height: 42px;
  min-width: 0;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--muted);
  font-weight: 750;
  cursor: pointer;
}

.tab-button:hover {
  color: var(--text);
  background: var(--card-soft);
}

.tab-button.is-active {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.18);
}

.main-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: clamp(20px, 2.3vw, 26px);
}

.standalone-card {
  max-width: 760px;
  margin: 0 auto;
}

.tab-panel {
  display: grid;
  gap: 16px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
}

.panel-head.compact {
  margin-bottom: 14px;
}

.panel-head h2,
.panel-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 25px;
  line-height: 1.25;
}

.panel-head h3 {
  font-size: 20px;
}

.panel-head .section-kicker {
  margin-bottom: 5px;
}

.ghost-link,
.secondary-button,
.compact-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  padding: 0 16px;
  font-size: 14px;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.ghost-link:hover,
.secondary-button:hover,
.compact-button:hover {
  border-color: #98a2b3;
  background: #f9fafb;
  text-decoration: none;
}

.notice-box,
.preview-card,
.result-card,
.batch-window {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card-soft);
  padding: 16px;
}

.notice-box {
  background: #f7fbff;
  padding: 14px 18px;
}

.notice-box h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.notice-box ol {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 22px;
  color: #344054;
  line-height: 1.52;
}

.notice-box p {
  margin: 8px 0 0;
  border-top: 1px solid #dbeafe;
  padding-top: 9px;
  color: #6941c6;
  font-weight: 700;
  line-height: 1.5;
}

.exchange-form,
.batch-form {
  display: grid;
  gap: 12px;
}

.field-block {
  display: grid;
  gap: 8px;
}

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

.field-head label {
  min-width: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 780;
}

.field-head span,
.field-head a {
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  background: #ffffff;
  color: var(--text);
  outline: none;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

input {
  min-height: 50px;
  padding: 0 16px;
}

textarea {
  height: 118px;
  min-height: 118px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.6;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow:
    0 0 0 4px rgba(37, 99, 235, 0.12),
    0 1px 2px rgba(16, 24, 40, 0.04);
}

.primary-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #ffffff;
  padding: 0 22px;
  font-weight: 820;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(17, 24, 39, 0.16);
}

.primary-button:hover {
  background: var(--primary-hover);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.full-button {
  width: 100%;
}

.status-line {
  min-height: 18px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.status-line.center {
  text-align: center;
}

.status-line.success {
  color: var(--success);
}

.status-line.error {
  color: var(--danger);
}

.status-line.pending {
  color: var(--warn);
}

.preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.preview-list.compact {
  grid-template-columns: 1fr;
}

.preview-list div {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  padding: 10px 12px;
}

dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  color: var(--text);
  font-weight: 750;
}

.result-card {
  background: #ffffff;
}

.feedback-card {
  display: grid;
  gap: 5px;
  border-color: var(--line);
  background: #f8fafc;
  padding: 14px 16px;
}

.result-label,
.request-id {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.result-card h3 {
  margin: 0 0 6px;
  font-size: 22px;
}

.result-card p {
  line-height: 1.65;
}

#resultMessage {
  margin: 0 0 6px;
  color: #344054;
}

.feedback-card .secondary-button {
  width: fit-content;
  min-height: 36px;
  margin-top: 2px;
  padding: 0 14px;
  font-size: 13px;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.batch-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: stretch;
}

.batch-window {
  display: grid;
  gap: 10px;
  align-content: start;
  background: #ffffff;
  padding: 13px;
}

.batch-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.batch-window h3 {
  margin: 0;
  font-size: 17px;
}

.batch-window input {
  min-height: 43px;
  border-radius: 15px;
  padding: 0 14px;
}

.batch-window textarea {
  height: 82px;
  min-height: 82px;
  border-radius: 15px;
  padding: 12px 14px;
}

.batch-window .primary-button {
  min-height: 43px;
  font-size: 14px;
}

.batch-window .field-head label,
.batch-window .field-head span,
.batch-window .field-head a {
  font-size: 12px;
}

.delete-batch {
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: #f9fafb;
  color: var(--muted);
  padding: 0 10px;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.delete-batch:hover {
  border-color: #fecdca;
  color: var(--danger);
  background: var(--danger-bg);
}

.batch-feedback {
  display: grid;
  gap: 4px;
  min-height: 112px;
  border-radius: 14px;
  background: #f9fafb;
  padding: 10px;
}

.batch-feedback-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #344054;
  font-size: 12px;
  line-height: 1.32;
}

.batch-feedback-row span:first-child {
  color: var(--muted);
  font-weight: 700;
}

.batch-feedback-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

.mini-confirm {
  width: fit-content;
  min-height: 38px;
  padding: 0 14px;
  font-size: 13px;
  box-shadow: none;
}

[hidden] {
  display: none !important;
}

@media (max-width: 760px) {
  .page-shell {
    width: min(100% - 24px, 1080px);
    padding: 22px 0 42px;
  }

  .hero {
    text-align: left;
  }

  .hero h1 {
    font-size: 30px;
  }

  .hero-subtitle {
    margin-left: 0;
    font-size: 15px;
    line-height: 1.52;
    overflow-wrap: anywhere;
  }

  .tabs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 5px;
    border-radius: 18px;
    padding: 5px;
  }

  .tab-button {
    min-height: 38px;
    border-radius: 13px;
    font-size: 13px;
    padding: 0 4px;
    white-space: nowrap;
  }

  .main-card {
    border-radius: 22px;
    padding: 14px;
  }

  .panel-head {
    display: grid;
    gap: 8px;
  }

  .field-head,
  .batch-window-head {
    display: flex;
    align-items: flex-start;
  }

  .inline-form {
    grid-template-columns: 1fr;
  }

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

  .batch-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .ghost-link,
  .compact-button,
  .secondary-button,
  .primary-button {
    width: 100%;
  }

  textarea {
    min-height: 126px;
  }

  .notice-box {
    padding: 13px 14px;
  }

  .notice-box ol {
    font-size: 14px;
  }

  .batch-window {
    padding: 13px;
  }

  .batch-window textarea {
    height: 96px;
    min-height: 96px;
  }

  .batch-feedback {
    min-height: 108px;
  }
}
