:root {
  --bg: #090d14;
  --panel: #111927;
  --panel-2: #172234;
  --line: #2a3850;
  --text: #e8effa;
  --muted: #93a4bb;
  --accent: #2f6fed;
  --accent-2: #3ddc97;
  --danger: #f26b6b;
  --warning: #f6c453;
  --shadow: 0 22px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% -10%, rgba(47, 111, 237, 0.2), transparent 34rem),
    radial-gradient(circle at 95% 5%, rgba(61, 220, 151, 0.08), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft YaHei UI", "PingFang SC", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.hidden {
  display: none !important;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 76px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
  background: rgba(9, 13, 20, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.top-actions,
.section-heading,
.inline-form,
.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, #3e83ff, #1d4da8);
  font-weight: 800;
  letter-spacing: 0.08em;
  box-shadow: 0 8px 25px rgba(47, 111, 237, 0.3);
}

.brand strong {
  display: block;
  font-size: 15px;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.shell {
  width: min(1240px, calc(100% - 40px));
  margin: 34px auto 60px;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 8px;
  font-size: clamp(28px, 3.4vw, 44px);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 14px;
  font-size: 18px;
}

.auth-card {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.7fr);
  gap: 42px;
  align-items: center;
  min-height: 62vh;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(23, 34, 52, 0.78), rgba(12, 19, 31, 0.92));
  box-shadow: var(--shadow);
}

.auth-copy p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.8;
}

.eyebrow {
  display: block;
  margin-bottom: 12px;
  color: #6ea0ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.feature-list {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  color: #b8c8df;
  line-height: 2;
}

.feature-list li::before {
  content: "✓";
  margin-right: 10px;
  color: var(--accent-2);
}

.panel,
.stat-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(17, 25, 39, 0.88);
}

.form-panel,
.panel {
  padding: 22px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
  color: #bccbe0;
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  background: #0d1521;
  color: var(--text);
}

input:focus,
select:focus,
textarea:focus {
  border-color: #4a86ff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.16);
}

textarea {
  resize: vertical;
  line-height: 1.65;
}

.button {
  min-height: 40px;
  padding: 8px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: var(--text);
}

.button.primary {
  background: linear-gradient(135deg, #357af5, #245cc7);
}

.button.secondary {
  border-color: #36517a;
  background: #172a45;
}

.button.ghost {
  border-color: var(--line);
  background: transparent;
}

.button.danger {
  border-color: #68343a;
  background: #35171b;
  color: #ffb9bf;
}

.button.tiny {
  min-height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.messages,
.message {
  min-height: 20px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.message.error {
  color: #ff9ba4;
}

.message.success {
  color: var(--accent-2);
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid #315073;
  border-radius: 999px;
  background: #13263d;
  color: #c4d7f0;
  font-size: 12px;
}

.pill.muted,
.muted {
  color: var(--muted);
}

.pill.good {
  border-color: rgba(61, 220, 151, 0.35);
  background: rgba(61, 220, 151, 0.1);
  color: #7df4c1;
}

.pill.bad {
  border-color: rgba(242, 107, 107, 0.35);
  background: rgba(242, 107, 107, 0.1);
  color: #ffadb3;
}

.section-heading {
  justify-content: space-between;
  margin-bottom: 22px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.stat-card {
  padding: 18px;
}

.stat-card span {
  display: block;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.stat-card strong {
  font-size: 23px;
  letter-spacing: -0.02em;
}

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

.tabs {
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #0e1622;
}

.tab {
  flex: 1;
  padding: 10px 14px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
}

.tab.active {
  background: #1a2c45;
  color: var(--text);
}

.tab-panel {
  margin-top: 14px;
}

.toolbar {
  justify-content: space-between;
  margin-bottom: 12px;
}

.toolbar input {
  max-width: 360px;
}

.inline-form {
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.inline-form input,
.inline-form select {
  flex: 1 1 150px;
  width: auto;
}

.compact-panel {
  margin-top: 18px;
}

.release-form {
  margin-bottom: 14px;
}

.checkbox-row {
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  justify-content: start;
  cursor: pointer;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
}

.release-preview {
  background:
    linear-gradient(135deg, rgba(47, 111, 237, 0.11), transparent 55%),
    rgba(17, 25, 39, 0.9);
}

.broadcast-preview {
  overflow: hidden;
  margin-bottom: 18px;
  padding: 10px 12px;
  border: 1px solid #2d4362;
  border-radius: 10px;
  background: #0d1521;
  color: #b8cae2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-body {
  min-height: 88px;
  color: #c9d6e7;
  line-height: 1.8;
  white-space: pre-wrap;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(17, 25, 39, 0.86);
}

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

th,
td {
  padding: 13px 14px;
  border-bottom: 1px solid #202d41;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}

th {
  background: #141f30;
  color: #aebed3;
  font-weight: 600;
}

tbody tr:hover {
  background: rgba(47, 111, 237, 0.06);
}

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

.code-output {
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #315073;
  border-radius: 14px;
  background: #101f33;
}

.code-output pre,
dialog pre {
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: #aee8ff;
  font-family: Consolas, monospace;
}

dialog {
  width: min(560px, calc(100% - 30px));
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  color: var(--text);
  box-shadow: var(--shadow);
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.68);
}

@media (max-width: 860px) {
  .auth-card,
  .two-column {
    grid-template-columns: 1fr;
  }

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

  .topbar {
    padding: 0 16px;
  }

  .shell {
    width: min(100% - 24px, 1240px);
    margin-top: 20px;
  }
}
