* {
  box-sizing: border-box;
}

:root {
  --bg: #f4f1ff;
  --panel: rgba(255, 255, 255, 0.9);
  --line: rgba(109, 98, 246, 0.1);
  --text: #1f1f25;
  --sub: rgba(31, 31, 37, 0.56);
  --brand: #5b4ff0;
  --brand-weak: rgba(91, 79, 240, 0.12);
}

body {
  margin: 0;
  font-family: "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(159, 99, 255, 0.16), transparent 26%),
    linear-gradient(180deg, #f4f1ff 0%, #faf9ff 100%);
}

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px 1fr;
}

.sidebar {
  padding: 28px 22px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
}

.brand {
  font-size: 28px;
  font-weight: 800;
}

.subbrand {
  margin-top: 8px;
  color: var(--sub);
  line-height: 1.6;
}

.menuLabel {
  margin-top: 28px;
  font-size: 12px;
  color: rgba(31, 31, 37, 0.36);
}

.pill {
  display: inline-flex;
  margin-top: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--brand-weak);
  color: var(--brand);
  font-weight: 700;
}

.nav {
  margin-top: 28px;
  display: grid;
  gap: 10px;
}

.navItem,
.ghostBtn,
.primaryBtn,
.secondaryBtn {
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.navItem {
  width: 100%;
  text-align: left;
  padding: 14px 16px;
  background: transparent;
  color: rgba(31, 31, 37, 0.72);
}

.navItem.active {
  background: var(--brand-weak);
  color: var(--brand);
}

.ghostBtn,
.primaryBtn,
.secondaryBtn {
  height: 42px;
  padding: 0 18px;
}

.ghostBtn {
  background: #fff;
  color: var(--brand);
  box-shadow: 0 12px 24px rgba(91, 79, 240, 0.08);
}

.ghostBtn.danger {
  border-color: rgba(239, 68, 68, 0.35);
  color: rgba(255, 255, 255, 0.9);
}

.ghostBtn.danger:hover {
  background: rgba(239, 68, 68, 0.18);
}

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

.smallBtn {
  padding: 8px 10px;
  font-size: 12px;
}

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

.secCaptchaImg {
  width: 160px;
  height: 60px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.2);
  margin-top: 10px;
}

.primaryBtn {
  background: linear-gradient(90deg, #9f63ff 0%, #5b4ff0 100%);
  color: #fff;
}

.secondaryBtn {
  background: rgba(31, 31, 37, 0.06);
  color: #333;
}

.sidebar .ghostBtn {
  margin-top: 28px;
  width: 100%;
}

.main {
  padding: 28px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
}

.hero.compact {
  margin-bottom: 22px;
}

.hero h1 {
  margin: 0;
  font-size: 34px;
}

.hero p {
  margin: 10px 0 0;
  color: var(--sub);
}

.actions {
  display: flex;
  gap: 10px;
}

.statusCard,
.panel,
.card,
.categoryCard,
.libraryCard {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(104, 92, 231, 0.06);
}

.statusCard {
  min-width: 220px;
  padding: 20px 22px;
}

.statusLabel {
  font-size: 13px;
  color: rgba(31, 31, 37, 0.45);
}

.statusValue {
  margin-top: 8px;
  font-size: 26px;
  font-weight: 800;
}

.cards {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.card {
  padding: 18px;
}

.cardLabel {
  font-size: 12px;
  color: rgba(31, 31, 37, 0.48);
}

.cardValue {
  margin-top: 10px;
  font-size: 28px;
  font-weight: 800;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.grid.twoColumns {
  grid-template-columns: 1fr 1fr;
}

.panel,
.categoryCard,
.libraryCard {
  padding: 20px;
}

.panelHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.panel h2 {
  margin: 0;
  font-size: 20px;
}

.trendList,
.tableWrap,
.libraryList {
  margin-top: 18px;
}

.trendRow,
.statRow {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid rgba(31, 31, 37, 0.06);
}

.trendRow:last-child,
.statRow:last-child {
  border-bottom: none;
}

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

th,
td {
  padding: 12px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 31, 37, 0.06);
  font-size: 14px;
}

th {
  color: rgba(31, 31, 37, 0.48);
}

.categoryCard {
  display: grid;
  gap: 12px;
}

.categoryHead {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.categoryTitle {
  font-size: 20px;
  font-weight: 800;
}

.field,
.textarea,
.libraryInput,
.librarySelect {
  width: 100%;
  border: 1px solid rgba(31, 31, 37, 0.1);
  border-radius: 14px;
  padding: 12px 14px;
  font-size: 14px;
  background: #fff;
}

.textarea {
  min-height: 110px;
  resize: vertical;
}

.textarea.tall {
  min-height: 360px;
}

.hint {
  font-size: 12px;
  color: rgba(31, 31, 37, 0.46);
}

.libraryList {
  display: grid;
  gap: 14px;
}

.libraryCard {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 18px;
  align-items: start;
}

.thumbWrap {
  display: grid;
  gap: 10px;
}

.thumb {
  width: 132px;
  height: 132px;
  object-fit: contain;
  background: rgba(243, 242, 255, 0.8);
  border-radius: 18px;
}

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

.libraryField {
  display: grid;
  gap: 6px;
}

.libraryField.span2 {
  grid-column: span 2;
}

.libraryField.span3 {
  grid-column: span 3;
}

.libraryLabel {
  font-size: 12px;
  color: rgba(31, 31, 37, 0.48);
}

.tagGrid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(20, 20, 20, 0.12);
  border-radius: 12px;
  background: #fff;
}

.tagOption {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: rgba(17, 17, 17, 0.9);
}

.tagOption input {
  width: 14px;
  height: 14px;
}

.toggleRow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
}

.inlineActions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.libraryPager {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pagerText {
  font-size: 13px;
  color: rgba(31, 31, 37, 0.56);
}

.dangerBtn {
  background: rgba(239, 68, 68, 0.12);
  color: #b42318;
}

.dangerBtn:hover {
  background: rgba(239, 68, 68, 0.18);
}

.successText {
  color: #2f8f4e;
  font-size: 13px;
  font-weight: 700;
}

@media (max-width: 1280px) {
  .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .libraryCard {
    grid-template-columns: 1fr;
  }
}
