:root {
  --bg: #10151c;
  --panel: #1a2330;
  --panel-2: #243244;
  --line: #344559;
  --text: #eef3f8;
  --muted: #aeb9c6;
  --blue: #4d86e8;
  --green: #32b56b;
  --amber: #d6a442;
  --red: #d65c5c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

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

button {
  border: 0;
  border-radius: 6px;
  padding: 9px 13px;
  background: var(--blue);
  color: white;
  cursor: pointer;
  font-weight: 700;
}

button.secondary {
  background: #2f3e52;
  color: var(--text);
  border: 1px solid var(--line);
}

button.danger {
  background: var(--red);
}

button.success {
  background: var(--green);
}

button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #121923;
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

textarea {
  min-height: 180px;
  resize: vertical;
  line-height: 1.5;
}

.boot {
  padding: 48px;
  color: var(--muted);
}

.loading-screen {
  max-width: 560px;
}

.loading-title {
  color: var(--text);
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 16px;
}

.loading-bar {
  width: 100%;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #1b2533;
  border: 1px solid var(--line);
}

.loading-bar span {
  display: block;
  height: 100%;
  width: 8%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--green));
  transition: width .35s ease;
}

.loading-message {
  margin-top: 12px;
  font-size: 14px;
  color: var(--muted);
}

.shell {
  max-width: 1540px;
  margin: 0 auto;
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
}

.title h1 {
  margin: 0 0 6px;
  font-size: 26px;
}

.title p {
  margin: 0;
  color: var(--muted);
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.tab {
  background: transparent;
  color: var(--muted);
  border-radius: 6px 6px 0 0;
  border: 1px solid transparent;
}

.tab.active {
  color: var(--text);
  background: var(--panel);
  border-color: var(--line);
  border-bottom-color: var(--panel);
}

.section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 18px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 16px;
  background: #141c28;
  border-bottom: 1px solid var(--line);
  font-weight: 800;
}

.section-body {
  padding: 16px;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 170px auto;
  gap: 10px;
  align-items: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.card {
  min-height: 286px;
  background: #172232;
  border: 1px solid #2e3e53;
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.thumb {
  height: 132px;
  background: #0c1119;
  object-fit: cover;
  width: 100%;
}

.thumb.placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 800;
}

.card-body {
  padding: 13px;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.card h3 {
  margin: 0 0 4px;
  font-size: 16px;
}

.meta, .muted {
  color: var(--muted);
  font-size: 13px;
}

.desc {
  color: #d4dde8;
  font-size: 14px;
  line-height: 1.45;
  margin: 10px 0;
  flex: 1;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.tag {
  border-radius: 5px;
  padding: 4px 7px;
  color: #e6edf5;
  background: #27384f;
  font-size: 12px;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.badge {
  border-radius: 5px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  background: #344459;
}

.badge.enabled {
  background: var(--green);
  color: white;
}

.badge.disabled {
  background: #5f6671;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.field label {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.split {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.flash {
  margin-bottom: 14px;
  border-radius: 7px;
  padding: 12px 14px;
  background: #19314d;
  border: 1px solid #315b8e;
}

.flash.error {
  background: #482124;
  border-color: #914950;
}

.empty {
  color: var(--muted);
  padding: 22px;
  text-align: center;
}

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

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

@media (max-width: 720px) {
  .shell {
    padding: 16px;
  }

  .topbar, .row, .search-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .grid, .split, .form-grid {
    grid-template-columns: 1fr;
  }
}
