:root {
  color-scheme: light;
  --bg: #f6f8ff;
  --panel: rgba(255, 255, 255, 0.92);
  --panel2: rgba(240, 249, 255, 0.86);
  --green: #10b981;
  --blue: #2563eb;
  --purple: #7c3aed;
  --text: #172033;
  --muted: #64748b;
  --danger: #ef4444;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 8%, rgba(37, 99, 235, 0.2), transparent 30%),
    radial-gradient(circle at 88% 6%, rgba(124, 58, 237, 0.16), transparent 34%),
    radial-gradient(circle at 72% 86%, rgba(20, 184, 166, 0.18), transparent 36%),
    linear-gradient(135deg, #eff6ff, #ffffff 48%, #fff7ed);
  color: var(--text);
  font-family: Inter, "Microsoft YaHei", system-ui, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 28px;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(99, 102, 241, 0.14);
}

.brand {
  color: var(--blue);
  font-weight: 800;
  letter-spacing: 0.08em;
  margin-right: 12px;
}

.layout {
  max-width: 1380px;
  margin: 0 auto;
  padding: 24px;
}

.panel {
  background: linear-gradient(145deg, rgba(30, 30, 46, 0.96), rgba(21, 21, 36, 0.92));
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.hero {
  border-color: rgba(52, 211, 153, 0.34);
}

.tabs {
  position: sticky;
  top: 73px;
  z-index: 1;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  margin-bottom: 20px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 18px;
  backdrop-filter: blur(12px);
}

.tab {
  margin: 0;
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
}

.tab.active {
  background: linear-gradient(135deg, var(--green), var(--blue));
  color: #07111f;
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: block;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
}

.panel-head h2 {
  margin: 0;
}

.collapsible.collapsed .panel-body {
  display: none;
}

h1,
h2 {
  margin-top: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 20px;
  color: #1d4ed8;
}

.grid {
  display: grid;
  gap: 20px;
}

.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: block;
  margin: 12px 0 8px;
  color: var(--muted);
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 12px;
  background: #0f172a;
  color: var(--text);
  padding: 11px 12px;
  outline: none;
}

textarea {
  min-height: 96px;
  resize: vertical;
}

.inline-form {
  display: grid;
  grid-template-columns: 1.2fr 2fr 0.7fr auto;
  gap: 10px;
  align-items: center;
}

.users-form {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.log-filter-form {
  grid-template-columns: repeat(5, minmax(120px, 1fr));
}

.inline-form input,
.inline-form select {
  margin-top: 10px;
}

button {
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  font-weight: 800;
  padding: 10px 16px;
  margin: 10px 8px 0 0;
  cursor: pointer;
}

.link-button {
  background: transparent;
  color: var(--blue);
  padding-left: 0;
}

button:hover {
  filter: brightness(1.08);
}

button.danger,
.danger {
  background: linear-gradient(135deg, #fb7185, #f97316);
  color: white;
}

.table-wrap {
  overflow: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
  padding: 10px;
  text-align: left;
  vertical-align: top;
}

th {
  color: #1d4ed8;
  font-weight: 700;
}

td {
  color: #d1d5db;
}

.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(96, 165, 250, 0.16);
  color: #bfdbfe;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.status-completed,
.status-ok {
  color: var(--green);
}

.status-failed,
.status-cancelled {
  color: var(--danger);
}

.status-running,
.status-analyzing {
  color: var(--blue);
}

.stats {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat {
  padding: 10px 14px;
  border-radius: 14px;
  background: rgba(219, 234, 254, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.14);
}

#toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  max-width: 420px;
}

.toast {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #022c22;
  color: #d1fae5;
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.28);
  display: grid;
  place-items: center;
  z-index: 10;
  padding: 24px;
}

.hidden {
  display: none;
}

.modal-card {
  width: min(980px, 94vw);
  max-height: 88vh;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(99, 102, 241, 0.22);
  border-radius: 18px;
  box-shadow: 0 30px 90px rgba(79, 70, 229, 0.18);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

#previewContent {
  margin: 0;
  padding: 20px;
  max-height: 70vh;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.8;
  color: #e5e7eb;
  font-family: "Microsoft YaHei", system-ui, sans-serif;
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 14% 16%, rgba(37, 99, 235, 0.26), transparent 28%),
    radial-gradient(circle at 82% 18%, rgba(236, 72, 153, 0.16), transparent 30%),
    radial-gradient(circle at 74% 82%, rgba(20, 184, 166, 0.2), transparent 34%),
    linear-gradient(135deg, #eff6ff, #ffffff 44%, #fff7ed);
}

.login-card {
  width: min(440px, 92vw);
  padding: 38px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(240, 249, 255, 0.9));
  border: 1px solid rgba(99, 102, 241, 0.18);
  border-radius: 28px;
  box-shadow: 0 30px 90px rgba(79, 70, 229, 0.18);
}

.login-card h1 {
  margin-bottom: 6px;
  color: #172033;
}

.login-card p {
  color: var(--muted);
}

.login-card .brand {
  display: inline-flex;
  padding: 8px 12px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--purple), #14b8a6);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.22);
  margin-bottom: 16px;
}

.login-card input {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: #172033;
}

.login-card input:focus {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.login-card button[type="submit"] {
  width: 100%;
  margin-top: 16px;
  background: linear-gradient(135deg, var(--blue), var(--purple));
  color: white;
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.22);
}

.login-card .link-button {
  color: var(--blue);
  background: transparent;
  box-shadow: none;
}

.message {
  color: var(--danger);
  margin-top: 12px;
}

@media (max-width: 900px) {
  .two {
    grid-template-columns: 1fr;
  }

  .inline-form,
  .users-form,
  .log-filter-form {
    grid-template-columns: 1fr;
  }

  .layout {
    padding: 14px;
  }

  .topbar {
    padding: 14px;
  }
}
