:root {
  color-scheme: dark;
  --bg-1: #06131f;
  --bg-2: #0b1f2f;
  --panel: rgba(10, 22, 36, 0.58);
  --panel-strong: rgba(9, 19, 31, 0.74);
  --line: rgba(152, 214, 255, 0.14);
  --line-strong: rgba(152, 214, 255, 0.24);
  --text: #ecf7ff;
  --muted: #8ea7bc;
  --accent: #67e8f9;
  --accent-strong: #22d3ee;
  --accent-soft: rgba(103, 232, 249, 0.15);
  --warn: #f59e0b;
  --error: #fb7185;
  --shadow: 0 24px 80px rgba(2, 8, 20, 0.45);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 12% 18%, rgba(34, 211, 238, 0.14), transparent 18%),
    radial-gradient(circle at 85% 14%, rgba(59, 130, 246, 0.18), transparent 22%),
    linear-gradient(160deg, var(--bg-1) 0%, var(--bg-2) 48%, #040b13 100%);
  overflow-x: hidden;
}

.scene {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.panel {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px) saturate(140%);
  overflow: hidden;
}

.panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.09), transparent 34%, transparent 66%, rgba(103, 232, 249, 0.06));
  pointer-events: none;
}

.orb {
  position: absolute;
  border-radius: 999px;
  filter: blur(10px);
  animation: drift 18s ease-in-out infinite;
}

.orb-a {
  top: 7%;
  left: -6%;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.3), transparent 70%);
}

.orb-b {
  right: -4%;
  bottom: 8%;
  width: 340px;
  height: 340px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.26), transparent 70%);
  animation-duration: 22s;
}

.grid-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(152, 214, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(152, 214, 255, 0.05) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.8) 20%, rgba(0, 0, 0, 0.8) 80%, transparent);
}

.app-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 28px 0 36px;
}

.panel-heading,
.receive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-tag {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(7, 16, 27, 0.56);
  font-size: 0.82rem;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 20px;
}

.command-panel,
.monitor-panel {
  padding: 28px;
  animation: rise-in 620ms ease both;
}

.monitor-panel {
  animation-delay: 70ms;
}

h2,
h3 {
  margin: 0;
  font-size: 1.12rem;
}

.panel-kicker {
  margin: 0 0 6px;
  font-size: 0.76rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

button {
  position: relative;
  isolation: isolate;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 13px 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  overflow: hidden;
  transition: transform 180ms ease, opacity 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 22%, rgba(255, 255, 255, 0.24) 50%, transparent 78%);
  transform: translateX(-140%);
  transition: transform 280ms ease;
  z-index: -1;
}

.button-primary {
  color: #04141f;
  background: linear-gradient(135deg, #8ff6ff 0%, #4dd8f4 100%);
  box-shadow: 0 14px 30px rgba(34, 211, 238, 0.24);
}

.button-secondary {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(7, 16, 27, 0.6);
}

button:hover:enabled {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(6, 17, 30, 0.26);
}

button:hover:enabled::before {
  transform: translateX(140%);
}

button:active:enabled {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.field {
  display: grid;
  gap: 10px;
  margin-top: 24px;
}

.field-inline {
  max-width: 240px;
}

.field span {
  font-size: 0.95rem;
  font-weight: 700;
}

textarea,
select {
  width: 100%;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 22px;
  font: inherit;
  line-height: 1.6;
  color: var(--text);
  background: rgba(4, 12, 20, 0.56);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

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

textarea:focus,
select:focus,
button:focus-visible {
  outline: 2px solid rgba(103, 232, 249, 0.26);
  outline-offset: 2px;
}

textarea:focus,
select:focus {
  border-color: rgba(103, 232, 249, 0.34);
  box-shadow: 0 0 0 6px rgba(103, 232, 249, 0.08);
  transform: translateY(-1px);
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 0;
  margin-top: 20px;
}

.status-item {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(6, 15, 24, 0.42);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.status-item:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  background: rgba(8, 18, 30, 0.58);
}

dt {
  font-size: 0.8rem;
  color: var(--muted);
}

dd {
  margin: 8px 0 0;
  font-weight: 700;
  word-break: break-word;
}

.message-banner {
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 1px solid transparent;
  border-radius: 18px;
  font-weight: 600;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.message-banner.info {
  color: #d7efff;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(91, 109, 131, 0.18);
}

.message-banner.success {
  color: #b4fbff;
  border-color: rgba(34, 211, 238, 0.22);
  background: rgba(34, 211, 238, 0.14);
}

.message-banner.warning {
  color: var(--warn);
  border-color: rgba(245, 158, 11, 0.2);
  background: rgba(245, 158, 11, 0.12);
}

.message-banner.error {
  color: var(--error);
  border-color: rgba(251, 113, 133, 0.2);
  background: rgba(251, 113, 133, 0.12);
}

.receive-panel {
  margin-top: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--panel-strong);
}

.receive-head span {
  color: var(--muted);
  font-size: 0.82rem;
}

.receive-output {
  min-height: 376px;
  max-height: 420px;
  margin: 16px 0 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid rgba(103, 232, 249, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(103, 232, 249, 0.04), transparent 22%),
    rgba(2, 8, 16, 0.72);
  color: #d7fbff;
  font-size: 0.95rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

@keyframes drift {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(18px, -24px, 0) scale(1.04);
  }
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 860px) {
  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 20px, 100%);
    padding: 14px 0 20px;
  }

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

  .panel-heading,
  .receive-head {
    flex-direction: column;
    align-items: flex-start;
  }

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

  .actions {
    display: grid;
  }

  .receive-output {
    min-height: 220px;
  }
}
