:root {
  --bg: #f6f8fc;
  --card: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: #dbe4f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #7c3aed;
  --success: #16a34a;
  --danger: #dc2626;
  --terminal: #0f172a;
  --terminal-text: #e5e7eb;
  --shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 32rem),
    radial-gradient(circle at top right, rgba(124, 58, 237, 0.16), transparent 30rem),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  font-family: inherit;
}

.page-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 48px 0;
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

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

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

h1 {
  margin-bottom: 12px;
  font-size: clamp(34px, 5.2vw, 56px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

h2 {
  margin-bottom: 8px;
  font-size: 24px;
  letter-spacing: -0.03em;
}

.hero-description {
  max-width: 980px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
  white-space: nowrap;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(420px, 1.14fr);
  gap: 24px;
}

.right-stack {
  display: grid;
  gap: 24px;
}

.panel {
  padding: 26px;
  border: 1px solid rgba(219, 228, 240, 0.9);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-heading {
  margin-bottom: 22px;
}

.panel-heading.compact {
  margin-bottom: 16px;
}

.panel-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.7;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-bottom: 22px;
  padding: 28px;
  border: 2px dashed #b8c7dc;
  border-radius: 24px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.06), rgba(124, 58, 237, 0.06));
  transition: 180ms ease;
}

.drop-zone:hover,
.drop-zone.is-dragging,
.drop-zone.has-file {
  border-color: var(--primary);
  color: var(--text);
  transform: translateY(-1px);
}

.upload-icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin-bottom: 12px;
  border-radius: 18px;
  color: white;
  font-size: 30px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.26);
}

.drop-zone strong {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 17px;
}

.drop-zone span {
  display: block;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

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

input {
  width: 100%;
  padding: 14px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--text);
  outline: none;
  background: white;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

input[readonly] {
  color: #475569;
  background: #f8fafc;
}

small,
.validation-message,
.copy-tip {
  color: var(--muted);
  font-size: 13px;
}

.validation-message {
  min-height: 18px;
  margin: -2px 0 16px;
}

.validation-message.is-error {
  color: var(--danger);
}

.primary-button,
.secondary-button,
.ghost-button {
  border: 0;
  border-radius: 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.primary-button {
  width: 100%;
  padding: 16px 18px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.28);
}

.primary-button:not(:disabled):hover,
.secondary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  box-shadow: none;
}

.terminal {
  min-height: 340px;
  max-height: 420px;
  overflow: auto;
  padding: 20px;
  border-radius: 22px;
  color: var(--terminal-text);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.75;
  background:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    var(--terminal);
  background-size: 100% 34px;
}

.terminal p {
  margin: 0 0 4px;
}

.terminal .muted-line {
  color: #94a3b8;
}

.terminal .success-line {
  color: #86efac;
}

.terminal .error-line {
  color: #fca5a5;
}

.terminal .active-line::after {
  content: "";
  display: inline-block;
  width: 8px;
  height: 16px;
  margin-left: 5px;
  background: #93c5fd;
  transform: translateY(3px);
  animation: blink 1s steps(2, start) infinite;
}

.empty-result {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.result-card {
  display: grid;
  gap: 14px;
}

.hidden {
  display: none;
}

.success-badge {
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  color: #166534;
  font-size: 13px;
  font-weight: 800;
  background: #dcfce7;
}

.success-badge.is-error {
  color: #991b1b;
  background: #fee2e2;
}

#resultLink {
  overflow-wrap: anywhere;
  color: var(--primary-dark);
  font-size: 18px;
  font-weight: 800;
  text-decoration: none;
}

#resultLink:hover {
  text-decoration: underline;
}

.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.secondary-button,
.ghost-button {
  padding: 12px 16px;
}

.secondary-button {
  color: white;
  background: var(--primary);
}

.ghost-button {
  color: var(--primary-dark);
  background: #dbeafe;
}

.copy-tip {
  min-height: 18px;
  margin: 0;
  color: var(--success);
  font-weight: 700;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

@media (max-width: 900px) {
  .page-shell {
    width: min(100% - 28px, 720px);
    padding: 30px 0;
  }

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

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

  .hero-description {
    white-space: normal;
  }

}

@media (max-width: 560px) {
  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

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

  .terminal {
    min-height: 300px;
  }

}
