:root {
  color-scheme: dark;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #07111f;
  color: #e8f0fb;
  font-synthesis: none;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 12% 10%, rgba(38, 143, 255, .16), transparent 32rem),
    radial-gradient(circle at 88% 18%, rgba(47, 211, 167, .10), transparent 28rem),
    #07111f;
}

.shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 54px 0 72px;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: #61c8ff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .18em;
}

h1 { margin: 0; font-size: clamp(32px, 6vw, 50px); letter-spacing: -.04em; }
.subtitle { margin: 12px 0 0; color: #94a8bf; }

.health {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid rgba(90, 211, 171, .24);
  border-radius: 999px;
  background: rgba(25, 118, 94, .12);
  color: #77e2bd;
  font-size: 13px;
}

.health span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #55d6a9;
  box-shadow: 0 0 12px #55d6a9;
}

.card {
  margin-top: 18px;
  padding: 28px;
  border: 1px solid rgba(147, 174, 207, .14);
  border-radius: 18px;
  background: rgba(12, 27, 46, .86);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .24);
  backdrop-filter: blur(16px);
}

label {
  display: block;
  margin: 18px 0 8px;
  color: #becde0;
  font-size: 13px;
  font-weight: 700;
}

label:first-child { margin-top: 0; }

input, select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #28415e;
  border-radius: 10px;
  outline: none;
  background: #09182a;
  color: #ecf5ff;
  font: inherit;
  transition: border-color .18s, box-shadow .18s;
}

input:focus, select:focus {
  border-color: #3da9e9;
  box-shadow: 0 0 0 3px rgba(61, 169, 233, .14);
}

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.actions { display: flex; justify-content: flex-end; gap: 12px; margin-top: 26px; }

button {
  min-height: 44px;
  padding: 0 19px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 750;
  cursor: pointer;
}

button:disabled { cursor: wait; opacity: .6; }
.secondary { border: 1px solid #2f4967; background: transparent; color: #b8c9dc; }
.primary { background: linear-gradient(135deg, #2d9cef, #3bc9a0); color: #031420; }

.result-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
h2 { margin: 0; font-size: 18px; }

.state { padding: 6px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.state.idle { background: #172a40; color: #91a8c0; }
.state.running { background: #352d13; color: #ffd66a; }
.state.success { background: #11392d; color: #6fe1b8; }
.state.failed { background: #421f2b; color: #ff9eb5; }

.polling-status {
  min-height: 20px;
  margin: 16px 0 0;
  color: #94a8bf;
  font-size: 13px;
}

#submission-details { min-height: 280px; }

pre {
  min-height: 170px;
  max-height: 520px;
  margin: 20px 0 0;
  padding: 18px;
  overflow: auto;
  border: 1px solid #213a55;
  border-radius: 12px;
  background: #05101d;
  color: #bcd0e5;
  font: 13px/1.65 "Cascadia Code", Consolas, monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.admin-layout {
  display: block;
}

.admin-shell {
  position: relative;
  width: min(1400px, calc(100% - 40px));
  padding-left: 238px;
}

.admin-shell > .hero { min-height: 176px; }

.admin-layout > div > [role="tabpanel"] > .card,
.admin-layout > div > [role="tabpanel"] > section > .card { margin-top: 18px; }

.admin-sidebar {
  position: absolute;
  top: 54px;
  bottom: 72px;
  left: 0;
  width: 210px;
  min-height: 620px;
  margin: 0;
  display: flex;
  flex-direction: column;
  border-color: rgba(75, 169, 230, .24);
  background:
    linear-gradient(180deg, rgba(20, 50, 82, .96), rgba(8, 25, 43, .96));
}

.admin-sidebar h2 { margin: 0 0 22px; font-size: 19px; }
.admin-sidebar .actions { margin-top: auto; }
.admin-nav { display: grid; gap: 10px; }
.admin-nav p { margin: 0; }
.admin-nav button { min-height: 52px; }
.admin-nav button[aria-selected="true"] {
  box-shadow: 0 0 0 1px rgba(79, 195, 247, .26), 0 12px 32px rgba(14, 130, 194, .18);
}

[role="tabpanel"][hidden] { display: none !important; }

#submission-list { grid-template-columns: 1fr; gap: 10px; }

.record-tools {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(180px, .6fr);
  gap: 14px;
  margin-top: 18px;
}

.record-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 14px;
  color: #94a8bf;
  font-size: 13px;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  cursor: pointer;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: #3da9e9;
}

#filter-count { color: #8edcff; }

#view-dashboard > .card:first-child { margin-top: 0; }
#view-records > .card:first-child,
#view-proxy > .card:first-child { margin-top: 0; }
#dashboard-recent { min-height: 230px; }
#stat-total, #stat-pending, #stat-running, #stat-completed, #stat-failed {
  font-size: 28px;
  color: #8edcff;
}

.submission-item {
  width: 100%;
  height: auto;
  min-height: 48px;
  padding: 12px 14px;
  text-align: left;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.detail-field {
  padding: 13px;
  border: 1px solid #213a55;
  border-radius: 10px;
  background: #09182a;
}

.detail-field span { display: block; margin-bottom: 6px; color: #7f95ad; font-size: 12px; }
.detail-field strong { display: block; color: #e8f0fb; overflow-wrap: anywhere; }
.admin-section { margin-top: 18px; }
.secret-output, .detail-result { min-height: 92px; max-height: 280px; }

@media (max-width: 660px) {
  .shell { width: min(100% - 22px, 920px); padding-top: 28px; }
  .hero { align-items: flex-start; flex-direction: column; }
  .card { padding: 20px; }
  .grid { grid-template-columns: 1fr; gap: 0; }
  .record-tools { grid-template-columns: 1fr; gap: 0; }
  .record-options { align-items: flex-start; flex-direction: column; }
  .admin-shell { width: min(100% - 22px, 920px); padding-left: 0; }
  .admin-shell > .hero { min-height: 0; }
  .admin-sidebar {
    position: static;
    width: auto;
    min-height: 0;
    margin-top: 18px;
  }
  .admin-sidebar .actions { margin-top: 22px; }
  .admin-nav { grid-template-columns: 1fr; }
  .actions { flex-direction: column-reverse; }
  button { width: 100%; }
}
