:root {
  --bg-space: #05040c;
  --bg-depth: #0f0a20;
  --bg-card: rgba(20, 14, 40, 0.84);
  --text-main: #f8f5ff;
  --text-sub: #b8add8;
  --mars-gold: #f7b65d;
  --plasma-red: #ff4f72;
  --nebula-violet: #7a5cff;
  --aurora-cyan: #36e6d2;
  --success: #58efb5;
  --warning: #ffd170;
  --danger: #ff768c;
  --line: rgba(247, 182, 93, 0.28);
  --line-soft: rgba(122, 92, 255, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 12% 8%, rgba(247, 182, 93, 0.2), transparent 34%),
    radial-gradient(circle at 82% 18%, rgba(255, 79, 114, 0.25), transparent 36%),
    radial-gradient(circle at 46% 82%, rgba(122, 92, 255, 0.3), transparent 40%),
    linear-gradient(152deg, var(--bg-space), var(--bg-depth) 62%, #090714);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.72) 0 1px, transparent 1px),
    radial-gradient(circle at 70% 65%, rgba(255, 255, 255, 0.6) 0 1px, transparent 1px),
    linear-gradient(rgba(54, 230, 210, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(54, 230, 210, 0.08) 1px, transparent 1px);
  background-size:
    180px 180px,
    220px 220px,
    36px 36px,
    36px 36px;
  z-index: -2;
}

body::after {
  content: "";
  position: fixed;
  width: 86vmax;
  height: 86vmax;
  right: -36vmax;
  top: -44vmax;
  border-radius: 50%;
  border: 1px solid rgba(247, 182, 93, 0.18);
  box-shadow:
    0 0 0 26px rgba(247, 182, 93, 0.04),
    0 0 0 72px rgba(122, 92, 255, 0.06),
    0 0 120px rgba(255, 79, 114, 0.2);
  pointer-events: none;
  z-index: -1;
}

.page-shell {
  width: min(980px, 94vw);
  margin: 0 auto;
  padding: 18px 0 34px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px 16px;
  align-items: start;
  margin-bottom: 18px;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background:
    linear-gradient(126deg, rgba(247, 182, 93, 0.11), rgba(122, 92, 255, 0.14)),
    rgba(9, 6, 20, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 14px 40px rgba(6, 4, 16, 0.55);
}

.brand-block {
  min-width: 0;
}

.brand-kicker {
  margin: 0;
  color: var(--mars-gold);
  font-size: 12px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.brand-title {
  margin: 8px 0 0;
  font-family: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
  font-size: clamp(26px, 3.3vw, 40px);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-shadow: 0 0 26px rgba(255, 79, 114, 0.3);
}

.brand-subtitle {
  margin: 10px 0 0;
  color: var(--text-sub);
  font-size: 14px;
  line-height: 1.55;
}

.topbar-ops {
  display: flex;
  align-items: center;
  gap: 8px;
}

.signal-strip {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 7px 14px;
  background:
    linear-gradient(90deg, rgba(247, 182, 93, 0.16), rgba(122, 92, 255, 0.18), rgba(255, 79, 114, 0.16));
  font-size: 12px;
  color: #fbe4c4;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.signal-strip span {
  display: inline-block;
  animation: signal-move 11s linear infinite;
}

@keyframes signal-move {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-18%);
  }
}

.ghost-btn,
.primary-btn,
.danger-btn {
  border: none;
  border-radius: 12px;
  padding: 10px 15px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  min-height: 44px;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease, border-color 0.2s ease;
}

.ghost-btn {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(247, 182, 93, 0.35);
}

.primary-btn {
  color: #fff;
  background: linear-gradient(128deg, var(--plasma-red), var(--nebula-violet));
  box-shadow: 0 0 22px rgba(255, 79, 114, 0.34);
}

.danger-btn {
  color: #fff;
  background: linear-gradient(128deg, #ff7049, var(--plasma-red));
  box-shadow: 0 0 18px rgba(255, 112, 73, 0.32);
}

.ghost-btn:hover,
.primary-btn:hover,
.danger-btn:hover {
  transform: translateY(-1px);
}

.ghost-btn:focus-visible,
.primary-btn:focus-visible,
.danger-btn:focus-visible,
.input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(54, 230, 210, 0.22);
}

.ghost-btn:disabled,
.primary-btn:disabled,
.danger-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: 18px;
  padding: 16px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    0 14px 34px rgba(9, 6, 22, 0.5);
  backdrop-filter: blur(6px);
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 92px;
  height: 92px;
  border-radius: 0 18px 0 72px;
  background: linear-gradient(146deg, rgba(247, 182, 93, 0.3), rgba(122, 92, 255, 0));
  pointer-events: none;
}

.section-title {
  margin: 0;
  font-family: "STZhongsong", "Songti SC", "Noto Serif SC", serif;
  font-size: 20px;
  letter-spacing: 0.04em;
}

.query-row {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.query-row.compact {
  margin-top: 0;
}

.input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 6, 18, 0.78);
  color: var(--text-main);
  outline: none;
  min-height: 44px;
  font-size: 16px;
}

.input::placeholder {
  color: #988bbd;
}

.input:focus {
  border-color: var(--aurora-cyan);
}

.tip {
  margin-top: 10px;
  font-size: 12px;
  color: var(--text-sub);
}

.results {
  margin-top: 14px;
  display: grid;
  gap: 10px;
}

.result-card {
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-soft);
  background: linear-gradient(152deg, rgba(14, 10, 30, 0.92), rgba(10, 7, 22, 0.92));
  box-shadow: 0 10px 24px rgba(6, 4, 18, 0.36);
}

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.prize-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #ffe8c8;
  background: rgba(247, 182, 93, 0.2);
  border: 1px solid rgba(247, 182, 93, 0.42);
}

.status {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 999px;
}

.status.pending {
  color: var(--warning);
  background: rgba(255, 209, 112, 0.14);
  border: 1px solid rgba(255, 209, 112, 0.34);
}

.status.done {
  color: var(--success);
  background: rgba(88, 239, 181, 0.15);
  border: 1px solid rgba(88, 239, 181, 0.36);
}

.result-info {
  margin: 10px 0 14px;
  color: var(--text-sub);
  font-size: 14px;
  display: grid;
  gap: 4px;
}

.empty {
  text-align: center;
  color: var(--text-sub);
  padding: 16px 0;
}

.alert {
  font-size: 13px;
  margin-top: 8px;
  min-height: 20px;
}

.alert.error {
  color: var(--danger);
}

.alert.success {
  color: var(--success);
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(2, 1, 6, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-mask.show {
  display: flex;
}

.modal-panel {
  width: min(460px, 100%);
}

.form-grid {
  display: grid;
  gap: 10px;
}

.table-wrap {
  overflow: auto;
  border-radius: 12px;
  border: 1px solid var(--line-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(184, 173, 216, 0.22);
  padding: 10px;
  font-size: 13px;
  white-space: nowrap;
}

th {
  text-align: left;
  color: #d4c7f1;
  font-weight: 500;
  background: rgba(122, 92, 255, 0.08);
}

tr:nth-child(even) td {
  background: rgba(255, 255, 255, 0.01);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.stat-item {
  background: linear-gradient(140deg, rgba(8, 6, 18, 0.88), rgba(15, 11, 32, 0.88));
  border-radius: 12px;
  border: 1px solid var(--line-soft);
  padding: 12px;
}

.stat-label {
  color: var(--text-sub);
  font-size: 12px;
}

.stat-value {
  font-size: 24px;
  margin-top: 4px;
  font-weight: 700;
  font-family: "DIN Alternate", "Bahnschrift", "PingFang SC", sans-serif;
}

.spacer {
  height: 12px;
}

@media (max-width: 680px) {
  .page-shell {
    width: min(980px, 95vw);
  }

  .topbar {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .brand-kicker {
    letter-spacing: 0.18em;
  }

  .brand-title {
    font-size: clamp(22px, 8vw, 30px);
  }

  .topbar-ops {
    width: 100%;
    justify-content: flex-start;
  }

  .query-row {
    flex-direction: column;
    align-items: stretch;
  }

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

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
