:root {
  --bg-0: #04030a;
  --bg-1: #0c1022;
  --bg-2: #081f33;
  --bg-3: #1d1430;

  --panel: rgba(9, 12, 24, 0.78);
  --panel-strong: rgba(7, 10, 22, 0.9);

  --neon-cyan: #00ecff;
  --neon-pink: #ff2f74;
  --neon-lime: #cfff4d;
  --neon-orange: #ff9f47;

  --line: rgba(0, 236, 255, 0.38);
  --line-hot: rgba(255, 47, 116, 0.38);

  --text: #f2fbff;
  --muted: #a7c2d2;
  --ok: #67ffc7;
  --danger: #ff6b8f;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft Yahei", sans-serif;
  background:
    radial-gradient(1200px 620px at 14% 0%, rgba(255, 47, 116, 0.18), transparent 62%),
    radial-gradient(980px 620px at 88% 16%, rgba(0, 236, 255, 0.24), transparent 64%),
    linear-gradient(138deg, var(--bg-0), var(--bg-1) 36%, var(--bg-2) 70%, var(--bg-3));
  overflow-x: hidden;
}

.glow,
.noise {
  position: fixed;
  inset: -12%;
  pointer-events: none;
}

.glow {
  filter: blur(54px);
}

.glow-a {
  background: radial-gradient(circle at 12% 24%, rgba(255, 47, 116, 0.28), transparent 58%);
  animation: glow-drift-a 9s ease-in-out infinite;
}

.glow-b {
  background: radial-gradient(circle at 84% 24%, rgba(0, 236, 255, 0.32), transparent 60%);
  animation: glow-drift-b 11s ease-in-out infinite;
}

.noise {
  opacity: 0.12;
  background-image:
    linear-gradient(to bottom, rgba(255, 255, 255, 0) 96%, rgba(0, 236, 255, 0.24) 100%),
    repeating-linear-gradient(
      90deg,
      rgba(0, 236, 255, 0.06) 0,
      rgba(0, 236, 255, 0.06) 1px,
      transparent 1px,
      transparent 18px
    ),
    repeating-linear-gradient(
      0deg,
      rgba(255, 47, 116, 0.05) 0,
      rgba(255, 47, 116, 0.05) 1px,
      transparent 1px,
      transparent 14px
    );
  background-size: 100% 4px, 100% 100%, 100% 100%;
  animation: noise-slide 18s linear infinite;
}

.wrap {
  max-width: 1390px;
  margin: 0 auto;
  padding: 24px 16px 34px;
  position: relative;
  z-index: 1;
}

.wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    -22deg,
    transparent 0,
    transparent 42px,
    rgba(255, 47, 116, 0.035) 42px,
    rgba(255, 47, 116, 0.035) 43px,
    transparent 43px,
    transparent 80px
  );
  mix-blend-mode: screen;
}

.panel {
  position: relative;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 0 0 1px rgba(0, 236, 255, 0.08),
    0 0 0 1px rgba(0, 236, 255, 0.05),
    0 22px 50px rgba(0, 0, 0, 0.48),
    0 0 32px rgba(0, 236, 255, 0.08);
}

.shell {
  overflow: hidden;
  animation: shell-in 620ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.shell::before,
.shell::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(0, 236, 255, 0.34);
  pointer-events: none;
}

.shell::before {
  top: 8px;
  left: 8px;
  border-right: 0;
  border-bottom: 0;
  clip-path: polygon(0 0, 100% 0, 0 100%);
}

.shell::after {
  right: 8px;
  bottom: 8px;
  border-left: 0;
  border-top: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

.hero {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(0, 236, 255, 0.26);
  background:
    linear-gradient(118deg, rgba(255, 47, 116, 0.14), rgba(0, 236, 255, 0.16)),
    repeating-linear-gradient(
      -26deg,
      rgba(0, 0, 0, 0) 0,
      rgba(0, 0, 0, 0) 12px,
      rgba(255, 47, 116, 0.06) 12px,
      rgba(255, 47, 116, 0.06) 16px,
      rgba(0, 0, 0, 0) 16px,
      rgba(0, 0, 0, 0) 30px
    );
  clip-path: polygon(0 0, calc(100% - 24px) 0, 100% 24px, 100% 100%, 0 100%);
}

.hero::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-pink), var(--neon-cyan), var(--neon-lime), transparent);
  animation: edge-pulse 2.8s ease-in-out infinite;
}

.hero::after {
  content: "TOKYO ARCADE // DISTRICT 13";
  position: absolute;
  right: 16px;
  top: 8px;
  font-family: "Audiowide", "Orbitron", sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.2em;
  color: rgba(207, 255, 77, 0.78);
}

.eyebrow {
  margin: 0;
  font-family: "Audiowide", "Orbitron", "Rajdhani", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #8ef7ff;
  text-shadow:
    0 0 12px rgba(0, 236, 255, 0.62),
    0 0 24px rgba(255, 47, 116, 0.25);
}

h1,
h2 {
  margin: 0;
  font-family: "Rajdhani", "Noto Sans SC", sans-serif;
}

h1 {
  margin-top: 4px;
  font-family: "Orbitron", "Rajdhani", "Noto Sans SC", sans-serif;
  font-size: clamp(1.46rem, 3.35vw, 2.4rem);
  letter-spacing: 0.04em;
  background: linear-gradient(90deg, #9ff8ff 0%, #ffffff 30%, #ff78a8 62%, #ffcc80 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    -1px 0 rgba(255, 47, 116, 0.35),
    1px 0 rgba(0, 236, 255, 0.35),
    0 0 20px rgba(0, 236, 255, 0.2);
}

h2 {
  font-size: 1.1rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.sub {
  margin: 7px 0 0;
  color: var(--muted);
  max-width: 760px;
}

.hero-actions {
  display: grid;
  align-content: start;
  gap: 10px;
  justify-items: end;
}

.mode-toggle {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.mode-btn {
  min-width: 98px;
  padding: 7px 12px;
}

.mode-btn.active {
  border-color: rgba(103, 255, 199, 0.74);
  box-shadow: 0 0 18px rgba(103, 255, 199, 0.24);
}

.mode-status {
  border-color: rgba(255, 207, 77, 0.55);
  background: rgba(255, 207, 77, 0.14);
}

.mode-air-only {
  display: none;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(103, 255, 199, 0.52);
  background: rgba(103, 255, 199, 0.14);
  padding: 6px 12px;
  font-size: 0.84rem;
  box-shadow: 0 0 20px rgba(103, 255, 199, 0.2);
}

.status::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 14px rgba(103, 255, 199, 0.8);
  animation: live-dot 1.4s ease-in-out infinite;
}

.grid {
  padding: 16px;
  display: grid;
  grid-template-columns: 1.16fr 1fr;
  gap: 14px;
}

.card {
  position: relative;
  padding: 14px;
  background: linear-gradient(145deg, rgba(8, 12, 25, 0.9), rgba(8, 14, 28, 0.66));
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(0, 236, 255, 0.16);
  border-radius: inherit;
  pointer-events: none;
}

.card::after {
  content: "";
  position: absolute;
  left: -34%;
  top: -140%;
  width: 170%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(255, 47, 116, 0.8), rgba(0, 236, 255, 0.8), transparent);
  transform: rotate(-14deg);
  animation: card-scan 6.3s linear infinite;
  pointer-events: none;
}

.full {
  grid-column: 1 / -1;
}

.stream-wrap {
  margin-top: 10px;
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid rgba(0, 236, 255, 0.38);
  background: linear-gradient(180deg, rgba(4, 8, 14, 0.92), rgba(6, 14, 24, 0.88));
  box-shadow:
    inset 0 0 30px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(0, 236, 255, 0.15);
}

.stream-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0) 14%),
    repeating-linear-gradient(
      180deg,
      rgba(0, 236, 255, 0.06) 0,
      rgba(0, 236, 255, 0.06) 1px,
      transparent 1px,
      transparent 3px
    );
  mix-blend-mode: screen;
}

.stream-wrap::after {
  content: "";
  position: absolute;
  inset: -160% 0 auto;
  height: 86%;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 47, 116, 0.16), rgba(0, 236, 255, 0.2), transparent 72%);
  animation: stream-beam 4.2s linear infinite;
}

.stream {
  margin: 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 0;
  background: #020812;
  object-fit: contain;
}

.stream-guide-layer {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
}

.roi-box {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10%;
  width: 85%;
  border: 1px dashed rgba(0, 236, 255, 0.7);
  background: linear-gradient(180deg, rgba(0, 236, 255, 0.1), rgba(0, 236, 255, 0.02));
  z-index: 1;
}

.track-boxes-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
}

.track-box {
  position: absolute;
  border: 2px solid rgba(255, 159, 71, 0.94);
  border-radius: 6px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.3),
    0 0 14px rgba(255, 159, 71, 0.34);
}

.track-box.pending {
  border-color: rgba(103, 255, 199, 0.95);
  box-shadow: 0 0 16px rgba(103, 255, 199, 0.34);
}

.track-box-label {
  position: absolute;
  top: -20px;
  left: -1px;
  font-size: 0.67rem;
  line-height: 1;
  color: #041018;
  background: rgba(255, 159, 71, 0.95);
  border-radius: 7px;
  padding: 3px 7px;
  white-space: nowrap;
  font-family: "Rajdhani", "Noto Sans SC", sans-serif;
  letter-spacing: 0.05em;
}

.track-box.pending .track-box-label {
  background: rgba(103, 255, 199, 0.95);
}

.guide-line {
  position: absolute;
  pointer-events: none;
  z-index: 4;
}

.guide-line span {
  position: absolute;
  display: inline-block;
  font-size: 0.72rem;
  color: #effbff;
  background: rgba(3, 10, 20, 0.74);
  border: 1px solid rgba(0, 236, 255, 0.5);
  border-radius: 999px;
  padding: 1px 7px;
  white-space: nowrap;
}

.v-line {
  top: 0;
  bottom: 0;
  border-left: 2px dashed rgba(0, 236, 255, 0.9);
}

.v-line span {
  top: 8px;
  transform: translateX(-50%);
}

.h-line {
  left: 0;
  right: 0;
  border-top: 2px dashed rgba(0, 236, 255, 0.9);
}

.h-line span {
  left: 8px;
  transform: translateY(-50%);
}

.start-line {
  border-top-color: rgba(103, 255, 199, 0.96);
}

.start-line span {
  border-color: rgba(103, 255, 199, 0.52);
  color: #ddfff1;
}

.end-line {
  border-top-color: rgba(255, 95, 125, 0.96);
}

.end-line span {
  border-color: rgba(255, 95, 125, 0.56);
  color: #ffe0e8;
}

.hint {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.stream-tools {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.inline-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.field span {
  color: var(--muted);
  font-size: 0.86rem;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  border-radius: 10px;
  border: 1px solid rgba(0, 236, 255, 0.42);
  padding: 9px 10px;
  color: var(--text);
  background: rgba(4, 10, 18, 0.84);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--neon-lime);
}

input:focus,
select:focus {
  outline: none;
  border-color: rgba(0, 236, 255, 0.86);
  box-shadow: 0 0 0 3px rgba(0, 236, 255, 0.18), 0 0 20px rgba(0, 236, 255, 0.24);
  background: rgba(4, 12, 22, 0.94);
}

.btn {
  position: relative;
  border: 0;
  border-radius: 10px;
  padding: 9px 13px;
  font-family: "Rajdhani", "Noto Sans SC", sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  cursor: pointer;
  color: #041018;
  background: linear-gradient(112deg, var(--neon-pink), var(--neon-orange), var(--neon-cyan));
  box-shadow:
    0 0 18px rgba(255, 47, 116, 0.24),
    0 0 26px rgba(0, 236, 255, 0.18),
    inset 0 0 0 1px rgba(255, 255, 255, 0.26);
  transition: transform 0.14s ease, filter 0.2s ease, box-shadow 0.2s ease;
}

.btn::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.4), transparent 40%);
  pointer-events: none;
  mix-blend-mode: screen;
}

.btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
  box-shadow:
    0 0 24px rgba(255, 47, 116, 0.34),
    0 0 34px rgba(0, 236, 255, 0.24);
}

.btn:active {
  transform: translateY(0);
}

.btn.warn {
  background: linear-gradient(112deg, #ffaf4c, #ff5f7d, #ff2f74);
}

.btn.ghost {
  color: var(--text);
  border: 1px solid rgba(0, 236, 255, 0.42);
  background: rgba(4, 11, 20, 0.68);
  box-shadow: none;
}

.btn.ghost:hover {
  box-shadow: 0 0 16px rgba(0, 236, 255, 0.24);
}

.btn.ghost.danger {
  border-color: rgba(255, 95, 125, 0.62);
  color: #ffd9e2;
}

.btn-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.result {
  min-height: 72px;
  border-radius: 11px;
  border: 1px solid rgba(0, 236, 255, 0.35);
  background: rgba(3, 10, 19, 0.8);
  padding: 10px;
  line-height: 1.5;
}

.result.warn {
  border-color: rgba(255, 95, 125, 0.66);
  color: #ffd7e1;
}

.pending-list {
  margin-top: 10px;
  min-height: 52px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pending-item {
  border-radius: 999px;
  border: 1px solid rgba(103, 255, 199, 0.54);
  background: rgba(103, 255, 199, 0.14);
  padding: 6px 10px;
  font-size: 0.86rem;
}

.table-wrap {
  margin-top: 10px;
  overflow: auto;
}

.auto-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 12px;
}

.auto-config,
.auto-runtime {
  border: 1px solid rgba(0, 236, 255, 0.28);
  border-radius: 12px;
  padding: 10px;
  background: var(--panel-strong);
  box-shadow:
    inset 0 0 0 1px rgba(0, 236, 255, 0.08),
    0 0 14px rgba(255, 47, 116, 0.05);
}

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

.row-check {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.runtime-box {
  border: 1px solid rgba(0, 236, 255, 0.3);
  border-radius: 10px;
  background: rgba(2, 9, 17, 0.82);
  padding: 9px;
  font-size: 0.86rem;
  color: var(--muted);
  line-height: 1.58;
}

.flight-editor {
  margin-top: 10px;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.flight-btn-row {
  margin-top: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.flight-grid {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.flight-item {
  border: 1px solid rgba(0, 236, 255, 0.26);
  border-radius: 10px;
  padding: 8px 9px;
  background: rgba(2, 9, 18, 0.76);
  box-shadow: inset 0 0 0 1px rgba(0, 236, 255, 0.05);
}

.flight-item span {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.03em;
}

.flight-item strong {
  margin-top: 4px;
  display: block;
  color: #e8fbff;
  font-family: "Orbitron", "Rajdhani", "Noto Sans SC", sans-serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  word-break: break-all;
}

.record-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.87rem;
}

.record-table th,
.record-table td {
  border-bottom: 1px solid rgba(0, 236, 255, 0.22);
  padding: 7px 8px;
  text-align: left;
}

.record-table tbody tr:nth-child(2n) {
  background: rgba(255, 47, 116, 0.03);
}

.record-table tbody tr:hover {
  background: rgba(0, 236, 255, 0.05);
}

.record-table th {
  color: #97f6ff;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

.speed-strong {
  color: var(--ok);
  font-family: "Orbitron", "Rajdhani", "Noto Sans SC", sans-serif;
  font-weight: 700;
  text-shadow: 0 0 12px rgba(103, 255, 199, 0.3);
}

.thumb-link {
  color: #93f4ff;
  text-decoration: none;
}

.thumb-link:hover {
  text-decoration: underline;
}

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

@keyframes glow-drift-a {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(2%, 1%, 0) scale(1.05); }
}

@keyframes glow-drift-b {
  0%, 100% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-2%, 2%, 0) scale(1.04); }
}

@keyframes noise-slide {
  0% { transform: translateY(0); }
  100% { transform: translateY(18px); }
}

@keyframes edge-pulse {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

@keyframes live-dot {
  0%, 100% { transform: scale(0.85); opacity: 0.75; }
  50% { transform: scale(1.2); opacity: 1; }
}

@keyframes stream-beam {
  0% { transform: translateY(-30%); opacity: 0; }
  10% { opacity: 1; }
  80% { opacity: 0.35; }
  100% { transform: translateY(150%); opacity: 0; }
}

@keyframes card-scan {
  0% { transform: translateY(-24%) rotate(-14deg); opacity: 0; }
  8% { opacity: 0.8; }
  54% { opacity: 0.3; }
  100% { transform: translateY(700%) rotate(-14deg); opacity: 0; }
}

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

  .flight-editor {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .flight-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .wrap {
    padding: 12px 10px 18px;
  }

  .hero {
    flex-direction: column;
    align-items: flex-start;
    padding: 14px;
    clip-path: none;
  }

  .hero::after {
    right: 10px;
    top: 10px;
    font-size: 0.56rem;
    letter-spacing: 0.16em;
  }

  .hero-actions {
    justify-items: start;
  }

  .mode-toggle {
    justify-content: flex-start;
  }

  .grid {
    padding: 10px;
    gap: 10px;
  }

  .stream-tools {
    justify-content: flex-start;
  }

  .btn-row {
    grid-template-columns: 1fr;
  }

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

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

  .flight-editor {
    grid-template-columns: 1fr;
  }

  .flight-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

}
