:root {
  color-scheme: light;
  --bg: #eef3fb;
  --card: rgba(255, 255, 255, 0.9);
  --card-strong: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: rgba(148, 163, 184, 0.28);
  --line-strong: rgba(37, 99, 235, 0.28);
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-soft: #e8f0ff;
  --accent: #14b8a6;
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 12px 34px rgba(15, 23, 42, 0.08);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 8%, rgba(37, 99, 235, 0.2), transparent 28rem),
    radial-gradient(circle at 92% 14%, rgba(20, 184, 166, 0.18), transparent 24rem),
    linear-gradient(135deg, #f8fbff 0%, var(--bg) 52%, #e7eef9 100%);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background-image:
    linear-gradient(rgba(37, 99, 235, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 99, 235, 0.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, #000, transparent 75%);
}

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

.hero,
.panel,
.result-card,
.tabs {
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}

.hero {
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 28px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 32px;
}

.hero::after {
  position: absolute;
  right: -80px;
  bottom: -110px;
  width: 310px;
  height: 310px;
  border-radius: 50%;
  content: "";
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.2), rgba(20, 184, 166, 0.16));
  filter: blur(4px);
}

.hero-copy,
.hero-actions {
  position: relative;
  z-index: 1;
}

.hero-copy {
  max-width: 760px;
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  content: "";
  background: var(--accent);
  box-shadow: 0 0 0 6px rgba(20, 184, 166, 0.12);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  color: #0f172a;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

p,
small,
legend {
  color: var(--muted);
}

.hero p {
  max-width: 640px;
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.75;
}

.hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-chips span,
.status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  border: 1px solid rgba(37, 99, 235, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.66);
  color: #334155;
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
}

.status-pill {
  border-color: rgba(20, 184, 166, 0.3);
  background: rgba(240, 253, 250, 0.82);
  color: #0f766e;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  position: sticky;
  top: 12px;
  z-index: 10;
  margin: 22px 0;
  border-radius: 999px;
  padding: 8px;
}

button,
.tab {
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  padding: 12px 18px;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    background 0.18s ease,
    color 0.18s ease;
}

button:hover,
.tab:hover {
  background: var(--primary-dark);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.2);
  transform: translateY(-1px);
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.22);
  outline-offset: 2px;
}

.tab {
  background: transparent;
  color: #475569;
  box-shadow: none;
}

.tab.active {
  background: #0f172a;
  color: #fff;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
}

.secondary {
  background: #475569;
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  box-shadow: none;
}

.ghost-button:hover {
  background: var(--card-strong);
  box-shadow: var(--shadow-soft);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 0.78fr);
  gap: 22px;
  align-items: start;
}

.panel,
.result-card {
  border-radius: var(--radius-lg);
}

.panel {
  display: none;
  padding: 28px;
}

.panel.active {
  display: block;
  animation: panel-in 0.22s ease-out;
}

.panel-title {
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.panel-title p {
  margin-bottom: 0;
  line-height: 1.65;
}

label,
fieldset {
  display: block;
  margin-bottom: 18px;
}

label {
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

label > input,
label > textarea,
select {
  display: block;
  width: 100%;
  margin-top: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.82);
  color: var(--text);
  font: 15px/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  padding: 14px 15px;
  transition:
    border-color 0.18s ease,
    background 0.18s ease,
    box-shadow 0.18s ease;
}

label > input:hover,
label > textarea:hover,
select:hover {
  border-color: rgba(37, 99, 235, 0.2);
  background: #fff;
}

label > input:focus,
label > textarea:focus,
select:focus {
  border-color: var(--line-strong);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.08);
}

textarea {
  min-height: 180px;
  resize: vertical;
}

small {
  display: block;
  margin-top: 7px;
  font: 12px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  text-align: right;
}

.radio-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(248, 250, 252, 0.7);
  padding: 13px 15px;
}

.radio-row legend {
  font-size: 13px;
  font-weight: 800;
  padding: 0 6px;
}

.radio-row label,
.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 8px 18px 4px 0;
  color: #334155;
  font-size: 14px;
  font-weight: 800;
}

.radio-row input,
.inline-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--primary);
}

.button-row,
.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.result-card {
  position: sticky;
  top: 96px;
  min-height: 640px;
  overflow: hidden;
  padding: 0;
}

.result-card .panel-title {
  margin: 0;
  background: linear-gradient(135deg, #0f172a, #1e293b);
  color: #fff;
  padding: 22px 24px;
}

.result-card .panel-title h2 {
  color: #fff;
}

.result-card .panel-title p {
  color: #cbd5e1;
}

.result-list {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 534px;
  max-height: 72vh;
  overflow: auto;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.13), transparent 19rem),
    linear-gradient(180deg, #f8fafc, #eef2f7);
  padding: 18px;
}

.empty-result {
  display: grid;
  place-items: center;
  min-height: 470px;
  border: 1px dashed rgba(100, 116, 139, 0.32);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.65);
  padding: 28px;
  text-align: center;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin-bottom: 12px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(20, 184, 166, 0.16));
  color: var(--primary);
  font-size: 30px;
  font-weight: 900;
}

.empty-result h3,
.result-item h3 {
  margin: 0;
}

.empty-result p {
  max-width: 310px;
  margin: 10px 0 0;
  line-height: 1.65;
}

.result-item {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
  animation: panel-in 0.2s ease-out;
}

.result-item.error {
  border-color: rgba(180, 35, 24, 0.24);
  background: #fff7f6;
}

.result-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(20, 184, 166, 0.06)),
    rgba(255, 255, 255, 0.86);
  padding: 15px 16px;
}

.result-item.error .result-item-header {
  background: linear-gradient(135deg, rgba(180, 35, 24, 0.1), rgba(255, 255, 255, 0.86));
}

.result-item-header h3 {
  color: #0f172a;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.result-item-header time {
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.06);
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
}

.result-item-body {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.result-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 16px;
  background: rgba(248, 250, 252, 0.78);
  padding: 11px 12px;
}

.result-row.primary-row {
  border-color: rgba(37, 99, 235, 0.18);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.08), rgba(255, 255, 255, 0.72));
}

.result-item.error .result-row {
  border-color: rgba(180, 35, 24, 0.18);
  background: rgba(255, 241, 240, 0.82);
}

.result-key {
  color: #475569;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.5;
  text-transform: uppercase;
}

.result-value {
  color: #0f172a;
  font: 13px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  overflow-wrap: anywhere;
  word-break: break-word;
  background: transparent;
}

.primary-row .result-value {
  color: #1d4ed8;
  font-weight: 800;
}

.result-item.error .result-value {
  color: var(--danger);
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .layout {
    display: block;
  }

  .result-card {
    position: static;
    margin-top: 22px;
  }

  .result-list {
    max-height: none;
  }
}

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 1200px);
    padding: 16px 0 28px;
  }

  .hero {
    display: block;
    padding: 24px;
  }

  .hero-actions {
    align-items: flex-start;
    margin-top: 22px;
  }

  .tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: var(--radius-md);
  }

  .panel {
    padding: 22px;
  }

  .button-row,
  .form-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  button {
    width: 100%;
  }

  .result-row {
    grid-template-columns: 1fr;
    gap: 5px;
  }

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