:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  background: #050914;
  color: #eef8ff;
  --bg: #050914;
  --panel: rgba(9, 18, 34, 0.78);
  --panel-strong: rgba(12, 25, 47, 0.92);
  --line: rgba(59, 213, 255, 0.18);
  --line-strong: rgba(67, 232, 255, 0.44);
  --text: #eef8ff;
  --muted: #8ea4bb;
  --cyan: #20d9ff;
  --blue: #4d7cff;
  --violet: #835cff;
  --green: #28e6a0;
  --orange: #ff9f3f;
  --red: #ff6464;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 76% 12%, rgba(17, 189, 255, 0.2), transparent 30%),
    radial-gradient(circle at 14% 88%, rgba(131, 92, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #07111f 0%, #040711 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(70, 151, 255, 0.075) 1px, transparent 1px),
    linear-gradient(90deg, rgba(70, 151, 255, 0.075) 1px, transparent 1px);
  background-size: 48px 48px;
  animation: gridDrift 18s linear infinite;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(110deg, transparent 0%, rgba(32, 217, 255, 0.07) 48%, transparent 58%),
    radial-gradient(circle at center, transparent 0%, rgba(2, 4, 12, 0.72) 100%);
  animation: scanGlow 7s ease-in-out infinite alternate;
}

button,
input,
select {
  font: inherit;
}

button {
  position: relative;
  min-height: 40px;
  overflow: hidden;
  border: 0;
  border-radius: 10px;
  padding: 0 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 12px 28px rgba(32, 217, 255, 0.22);
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, filter 160ms ease;
}

button::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-120%) skewX(-22deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.42), transparent);
  transition: transform 620ms ease;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(32, 217, 255, 0.34);
  filter: saturate(1.08);
}

button:hover::after {
  transform: translateX(120%) skewX(-22deg);
}

button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
  box-shadow: none;
}

input,
select {
  width: 100%;
  height: 42px;
  border: 1px solid rgba(125, 185, 255, 0.26);
  border-radius: 10px;
  padding: 0 12px;
  outline: none;
  background: rgba(3, 8, 18, 0.72);
  color: #eff8ff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder {
  color: #688198;
}

input:focus,
select:focus {
  border-color: rgba(32, 217, 255, 0.82);
  background: rgba(5, 13, 30, 0.92);
  box-shadow: 0 0 0 4px rgba(32, 217, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.liveUrlField {
  display: grid;
  grid-template-columns: auto minmax(120px, 1fr);
  align-items: center;
  height: 42px;
  overflow: hidden;
  border: 1px solid rgba(125, 185, 255, 0.26);
  border-radius: 10px;
  background: rgba(3, 8, 18, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

.liveUrlField:focus-within {
  border-color: rgba(32, 217, 255, 0.82);
  background: rgba(5, 13, 30, 0.92);
  box-shadow: 0 0 0 4px rgba(32, 217, 255, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.liveUrlPrefix {
  display: inline-flex;
  align-items: center;
  align-self: stretch;
  padding: 0 0 0 12px;
  color: #eff8ff;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 900;
}

.liveUrlField input {
  height: 40px;
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding-left: 0;
  background: transparent;
  box-shadow: none;
}

.liveUrlField input:focus {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #79eaff 50%),
    linear-gradient(135deg, #79eaff 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 18px,
    calc(100% - 12px) 18px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.effectLayer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0.66;
  box-shadow: 0 0 14px rgba(32, 217, 255, 0.88);
  animation: floatParticle var(--duration, 9s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}

.particle::after {
  content: "";
  position: absolute;
  width: var(--tail, 70px);
  height: 1px;
  left: 2px;
  top: 2px;
  transform: rotate(var(--angle, 25deg));
  transform-origin: left center;
  background: linear-gradient(90deg, rgba(32, 217, 255, 0.35), transparent);
}

.shell {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100vw - 40px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.loginBox {
  position: relative;
  width: min(430px, 100%);
  margin: 13vh auto 0;
  padding: 34px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(13, 27, 50, 0.9), rgba(6, 13, 27, 0.88)),
    rgba(7, 14, 28, 0.88);
  box-shadow:
    0 28px 80px rgba(0, 0, 0, 0.44),
    0 0 46px rgba(32, 217, 255, 0.12);
  animation: panelEnter 520ms ease both;
}

.loginBox::before,
.panel::before,
.topbar::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(32, 217, 255, 0.25), transparent 28%, rgba(131, 92, 255, 0.18));
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  padding: 1px;
}

.loginBox h1,
.topbar h1,
.panel h2 {
  margin: 0;
}

.loginBox h1 {
  margin: 12px 0 24px;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
  text-shadow: 0 0 24px rgba(32, 217, 255, 0.34);
}

.brandLockup {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #91efff;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0;
}

.brandMark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  color: #ffffff;
  box-shadow: 0 0 24px rgba(32, 217, 255, 0.44);
}

.loginBox form {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #b6c7d7;
  font-size: 13px;
  font-weight: 900;
}

.hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.errorText {
  min-height: 20px;
  margin: 0;
  color: #ff8585;
  font-size: 13px;
}

.adminView {
  display: grid;
  gap: 18px;
  animation: panelEnter 520ms ease both;
}

.topbar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  overflow: hidden;
  padding: 24px 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(96deg, rgba(12, 28, 58, 0.98), rgba(9, 15, 33, 0.88)),
    rgba(8, 17, 35, 0.9);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
}

.topbar h1 {
  font-size: 34px;
  line-height: 1.12;
  text-shadow: 0 0 24px rgba(32, 217, 255, 0.3);
}

.eyebrow {
  margin: 0 0 6px;
  color: #59e4ff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.panel {
  position: relative;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(13, 29, 54, 0.82), rgba(7, 15, 30, 0.8)),
    rgba(8, 16, 31, 0.82);
  box-shadow:
    0 20px 58px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: panelEnter 620ms ease both;
}

.panel:hover {
  border-color: var(--line-strong);
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.34),
    0 0 38px rgba(32, 217, 255, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.panelTitle,
.panelHeader,
.generatedHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.panelActions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.panelActions select {
  width: 170px;
}

.formGrid {
  display: grid;
  grid-template-columns: 160px 150px 110px 190px minmax(260px, 1fr);
  gap: 14px;
  align-items: end;
}

.formGrid .wide {
  grid-column: span 1;
}

.generatedBox {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid rgba(40, 230, 160, 0.32);
  border-radius: 14px;
  background: rgba(8, 32, 28, 0.58);
  box-shadow: 0 0 28px rgba(40, 230, 160, 0.1);
}

.generatedHeader {
  margin: 0;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(40, 230, 160, 0.22);
}

.generatedBox pre {
  margin: 0;
  padding: 14px;
  overflow-x: auto;
  white-space: pre;
  color: #77ffd2;
  font-weight: 900;
}

.ghostButton {
  border: 1px solid rgba(125, 185, 255, 0.28);
  color: #dceeff;
  background: rgba(255, 255, 255, 0.055);
  box-shadow: none;
}

.ghostButton:hover {
  box-shadow: 0 10px 26px rgba(32, 217, 255, 0.14);
}

.statusText {
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.tableWrap {
  overflow: auto;
  border: 1px solid rgba(125, 185, 255, 0.2);
  border-radius: 14px;
  background: rgba(3, 8, 18, 0.5);
}

.tableWrap::-webkit-scrollbar,
.generatedBox pre::-webkit-scrollbar {
  height: 10px;
  width: 10px;
}

.tableWrap::-webkit-scrollbar-thumb,
.generatedBox pre::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(32, 217, 255, 0.3);
}

table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

th,
td {
  padding: 12px 11px;
  border-bottom: 1px solid rgba(125, 185, 255, 0.14);
  text-align: left;
  vertical-align: top;
  color: #d7e6f3;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(11, 24, 45, 0.96);
  color: #84e8ff;
  font-size: 12px;
  font-weight: 950;
}

tbody tr {
  animation: rowEnter 360ms ease both;
  animation-delay: var(--row-delay, 0ms);
  transition: background 140ms ease, transform 140ms ease;
}

tbody tr:hover {
  background: rgba(32, 217, 255, 0.06);
  transform: translateX(2px);
}

.urlCell {
  max-width: 320px;
  word-break: break-all;
}

.codeCell {
  min-width: 190px;
  white-space: nowrap;
  font-family: Consolas, "SFMono-Regular", monospace;
  letter-spacing: 0;
  color: #ffffff;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(32, 217, 255, 0.13);
  color: #8eedff;
  font-size: 12px;
  font-weight: 900;
}

.pill.disabled {
  background: rgba(255, 100, 100, 0.14);
  color: #ff9a9a;
}

.pill.active {
  background: rgba(40, 230, 160, 0.15);
  color: #7dffd1;
}

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

.actions button {
  min-height: 31px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 12px;
}

@keyframes gridDrift {
  from {
    background-position: 0 0, 0 0;
  }
  to {
    background-position: 48px 48px, 48px 48px;
  }
}

@keyframes scanGlow {
  from {
    opacity: 0.7;
    transform: translateX(-2%);
  }
  to {
    opacity: 1;
    transform: translateX(2%);
  }
}

@keyframes floatParticle {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(0.86);
    opacity: 0.28;
  }
  45% {
    transform: translate3d(var(--dx, 24px), var(--dy, -34px), 0) scale(1.2);
    opacity: 0.86;
  }
}

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

@keyframes rowEnter {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.flashIn {
  animation: flashIn 520ms ease both;
}

@keyframes flashIn {
  0% {
    opacity: 0.4;
    transform: translateY(8px);
    box-shadow: 0 0 0 rgba(40, 230, 160, 0);
  }
  60% {
    opacity: 1;
    transform: translateY(0);
    box-shadow: 0 0 34px rgba(40, 230, 160, 0.28);
  }
  100% {
    opacity: 1;
    box-shadow: 0 0 28px rgba(40, 230, 160, 0.1);
  }
}

@media (max-width: 980px) {
  .formGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 680px) {
  .shell {
    width: min(100% - 24px, 1280px);
    padding-top: 14px;
  }

  .loginBox {
    margin-top: 8vh;
    padding: 24px;
  }

  .formGrid,
  .panelHeader {
    grid-template-columns: 1fr;
  }

  .panelHeader,
  .panelActions {
    align-items: stretch;
    flex-direction: column;
  }

  .panelActions select {
    width: 100%;
  }
}
