:root {
  --bg: #080d20;
  --panel: rgba(17, 25, 58, 0.78);
  --panel2: rgba(25, 35, 78, 0.72);
  --text: #f6f7ff;
  --muted: #929abd;
  --line: rgba(151, 169, 255, 0.14);
  --blue: #5d8cff;
  --purple: #a269ff;
  --cyan: #40cfff;
  --shadow: 0 25px 80px rgba(0, 0, 0, 0.35);
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
  color-scheme: dark;
}
body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "SF Pro Display", "PingFang SC", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 14%, #243384 0, transparent 35%),
    radial-gradient(circle at 92% 85%, #7134ba 0, transparent 30%),
    linear-gradient(135deg, #070c1c, #0d1537 56%, #251452);
  overflow-x: hidden;
}
body.light {
  --bg: #edf1ff;
  --panel: rgba(255, 255, 255, 0.82);
  --panel2: rgba(247, 248, 255, 0.9);
  --text: #121933;
  --muted: #68708e;
  --line: rgba(51, 67, 130, 0.13);
  background:
    radial-gradient(circle at 80% 10%, #b7c6ff 0, transparent 35%),
    linear-gradient(135deg, #eef3ff, #e8e7ff 60%, #e3cfff);
}
button,
input,
select,
textarea {
  font: inherit;
}
.ambient {
  position: fixed;
  border-radius: 999px;
  filter: blur(80px);
  pointer-events: none;
  opacity: 0.5;
}
.a1 {
  width: 330px;
  height: 330px;
  background: #255fff;
  right: -100px;
  top: -80px;
}
.a2 {
  width: 400px;
  height: 400px;
  background: #9b46ff;
  right: -140px;
  bottom: -120px;
}
.shell {
  position: relative;
  display: grid;
  grid-template: 72px 1fr/300px 1fr;
  width: min(1240px, calc(100% - 48px));
  height: calc(100vh - 48px);
  min-height: 650px;
  margin: 24px auto;
  border: 1px solid rgba(116, 155, 255, 0.7);
  border-radius: 30px;
  overflow: hidden;
  background: rgba(7, 13, 34, 0.54);
  backdrop-filter: blur(24px);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.04) inset,
    var(--shadow);
}
.light .shell {
  background: rgba(255, 255, 255, 0.45);
}
header {
  grid-column: 1/3;
  display: grid;
  grid-template-columns: 300px 1fr auto;
  align-items: center;
  border-bottom: 1px solid var(--line);
}
.brand {
  padding-left: 38px;
  color: var(--text);
  text-decoration: none;
  font-size: 25px;
  font-weight: 850;
  letter-spacing: -1px;
}
.brand span {
  color: var(--blue);
  margin-left: 5px;
}
.search {
  width: min(420px, 60%);
  height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  margin-left: 30px;
  background: rgba(134, 153, 219, 0.14);
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  transition: 0.2s;
}
.search:focus-within {
  border-color: var(--blue);
  background: rgba(97, 128, 225, 0.18);
}
.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: none;
  color: var(--text);
}
.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
}
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 25px;
}
.mobile-admin {
  display: none;
  height: 38px;
  align-items: center;
  gap: 6px;
  padding: 0 12px;
  border: 1px solid rgba(93, 140, 255, 0.55);
  border-radius: 12px;
  color: #d7e3ff;
  background: rgba(72, 105, 211, 0.18);
  cursor: pointer;
}
.mobile-admin b {
  font-size: 12px;
}
.shell > aside {
  display: flex;
  flex-direction: column;
  padding: 34px 26px 24px;
  border-right: 1px solid var(--line);
  overflow: auto;
}
.eyebrow {
  margin: 0 12px 18px;
  font-size: 11px;
  letter-spacing: 2px;
  color: #7481b3;
}
.nav-item {
  display: flex;
  width: 100%;
  align-items: center;
  gap: 13px;
  margin: 5px 0;
  padding: 13px 16px;
  border: 1px solid transparent;
  border-radius: 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: 0.2s;
}
.nav-item i {
  font-style: normal;
  color: #839aff;
}
.nav-item:hover,
.nav-item.active {
  color: #fff;
  border-color: rgba(96, 136, 255, 0.4);
  background: linear-gradient(
    100deg,
    rgba(69, 106, 224, 0.48),
    rgba(86, 76, 186, 0.22)
  );
  box-shadow: 0 8px 24px rgba(38, 63, 150, 0.18);
}
.light .nav-item.active {
  color: #14204c;
}
.profile {
  display: flex;
  gap: 13px;
  align-items: center;
  margin-top: auto;
}
.avatar {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  font-size: 20px;
  font-weight: 800;
  color: white;
  background: linear-gradient(135deg, #4da4ff, #985cff);
  box-shadow: 0 0 0 4px rgba(120, 142, 255, 0.12);
}
.profile strong,
.profile span {
  display: block;
}
.profile span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}
.bio {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
}
.socials {
  display: flex;
  gap: 7px;
}
.socials a {
  padding: 6px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  text-decoration: none;
}
.admin-link {
  margin-top: 18px;
  padding: 11px;
  border: 1px solid #5986ff;
  border-radius: 12px;
  color: #b9ccff;
  background: transparent;
  cursor: pointer;
}
main {
  padding: 32px;
  overflow: auto;
  scroll-behavior: smooth;
}
.loading {
  display: grid;
  height: 60vh;
  place-items: center;
  color: var(--muted);
}
.hero {
  position: relative;
  min-height: 205px;
  padding: 29px;
  border: 1px solid #9b63ff;
  border-radius: 22px;
  background: linear-gradient(
    115deg,
    rgba(44, 51, 109, 0.72),
    rgba(16, 24, 59, 0.82)
  );
  overflow: hidden;
}
.hero:after {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  right: -50px;
  bottom: -140px;
  background: #714cff;
  filter: blur(30px);
  opacity: 0.42;
}
.hero .pin {
  font-size: 11px;
  color: #bd9aff;
  letter-spacing: 1.5px;
}
.hero h1 {
  max-width: 720px;
  margin: 14px 0 12px;
  font-size: clamp(25px, 3vw, 39px);
  line-height: 1.2;
}
.hero p {
  max-width: 720px;
  margin: 0;
  color: #a8b0ce;
  line-height: 1.8;
}
.meta {
  display: flex;
  gap: 18px;
  margin-top: 23px;
  color: #7d88af;
  font-size: 12px;
}
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 34px 4px 18px;
}
.section-head h2 {
  margin: 0;
  font-size: 24px;
}
.section-head span {
  color: var(--muted);
  font-size: 12px;
}
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.card {
  position: relative;
  display: grid;
  grid-template-columns: 110px 1fr;
  min-height: 160px;
  padding: 16px;
  border: 1px solid rgba(80, 177, 255, 0.55);
  border-radius: 18px;
  background: linear-gradient(
    130deg,
    rgba(22, 38, 83, 0.76),
    rgba(27, 26, 73, 0.62)
  );
  cursor: pointer;
  transition: 0.25s;
  overflow: hidden;
}
.card:hover {
  transform: translateY(-4px);
  border-color: #8e75ff;
  box-shadow: 0 18px 42px rgba(23, 38, 100, 0.35);
}
.card-cover {
  width: 92px;
  height: 112px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(145deg, #1674d9, #6336d8);
}
.cover-placeholder {
  display: grid;
  place-items: center;
  font-size: 30px;
  color: white;
}
.card h3 {
  margin: 4px 0 10px;
  font-size: 17px;
  line-height: 1.4;
}
.card p {
  display: -webkit-box;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card .meta {
  margin-top: 13px;
}
.article {
  max-width: 820px;
  margin: 0 auto;
}
.back {
  border: 0;
  background: none;
  color: #8ca9ff;
  cursor: pointer;
  padding: 0 0 20px;
}
.article-cover {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  border-radius: 20px;
}
.article h1 {
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.13;
  letter-spacing: -2px;
}
.article .lead {
  font-size: 18px;
  color: var(--muted);
  line-height: 1.8;
}
.prose {
  margin-top: 35px;
  color: #dce1f4;
  font-size: 17px;
  line-height: 1.9;
}
.light .prose {
  color: #252d4e;
}
.prose h2,
.prose h3 {
  margin-top: 2em;
  color: var(--text);
}
.prose img,
.prose video {
  max-width: 100%;
  height: auto;
  border-radius: 14px;
}
.prose blockquote {
  margin: 25px 0;
  padding: 15px 22px;
  border-left: 3px solid var(--purple);
  background: rgba(123, 95, 230, 0.1);
  border-radius: 0 12px 12px 0;
}
.prose a {
  color: #75a8ff;
}
.comments {
  margin-top: 64px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}
.comments-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 20px;
}
.comments-head .eyebrow {
  display: block;
  margin: 0 0 8px;
}
.comments-head h2 {
  margin: 0;
  font-size: 25px;
}
.comments-head > span {
  color: var(--muted);
  font-size: 12px;
}
.comment-form {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}
.comment-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.field em {
  margin-left: 5px;
  color: #6f7a9f;
  font-size: 10px;
  font-style: normal;
}
.comment-image-picker {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 13px;
  border: 1px dashed rgba(117, 151, 255, 0.45);
  border-radius: 10px;
  color: #9bb4ff;
  cursor: pointer;
}
.comment-image-picker small {
  color: var(--muted);
}
#comment-preview {
  position: relative;
  width: fit-content;
  margin-top: 12px;
}
#comment-preview img {
  width: 120px;
  height: 90px;
  border-radius: 10px;
  object-fit: cover;
}
.remove-preview {
  position: absolute;
  top: 5px;
  right: 5px;
  padding: 4px 7px;
  border: 0;
  border-radius: 7px;
  color: white;
  background: rgba(10, 14, 30, 0.78);
  cursor: pointer;
}
.comment-submit {
  float: right;
  min-width: 120px;
  margin-top: 12px;
}
.comment-form::after {
  display: block;
  clear: both;
  content: "";
}
.honeypot {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.comment-list {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.comment {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 13px;
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(19, 27, 59, 0.55);
}
.light .comment {
  background: rgba(255, 255, 255, 0.55);
}
.comment-avatar {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: white;
  font-weight: 700;
  background: linear-gradient(135deg, #4b9af7, #8b5ae5);
}
.comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.comment-meta time {
  color: var(--muted);
  font-size: 11px;
}
.comment p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.comment img {
  max-width: min(320px, 100%);
  max-height: 320px;
  margin-top: 12px;
  border-radius: 11px;
  object-fit: contain;
}
.empty-comments,
.loading-small {
  padding: 24px;
  text-align: center;
  color: var(--muted);
}
.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 12px;
  color: white;
  background: rgba(4, 8, 23, 0.74);
  backdrop-filter: blur(10px);
}
.busy-overlay small {
  color: #9ca8cb;
}
.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.18);
  border-top-color: #78a3ff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
.empty {
  padding: 70px 20px;
  text-align: center;
  color: var(--muted);
}
.admin {
  max-width: 960px;
  margin: auto;
}
.admin-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}
.primary,
.secondary,
.danger {
  padding: 10px 16px;
  border: 0;
  border-radius: 11px;
  cursor: pointer;
}
.primary {
  color: white;
  background: linear-gradient(135deg, #4c8cff, #8d58ef);
}
.secondary {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}
.danger {
  color: #ffafb9;
  background: rgba(255, 76, 100, 0.1);
}
.admin-list {
  display: grid;
  gap: 10px;
}
.admin-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.admin-row .grow {
  flex: 1;
}
.admin-row small {
  color: var(--muted);
}
.badge {
  padding: 4px 8px;
  border-radius: 99px;
  font-size: 11px;
  background: rgba(84, 226, 174, 0.12);
  color: #68e6b5;
}
.badge.draft {
  background: rgba(255, 179, 71, 0.12);
  color: #ffc775;
}
.login {
  display: grid;
  place-items: center;
  min-height: 60vh;
}
.login-card {
  width: min(380px, 100%);
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  text-align: center;
}
.login-card input,
.field input,
.field textarea,
.field select {
  width: 100%;
  margin-top: 8px;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(7, 12, 32, 0.5);
  color: var(--text);
  outline: 0;
}
.login-card input:focus,
.field input:focus,
.field textarea:focus {
  border-color: var(--blue);
}
.login-card .primary {
  width: 100%;
  margin-top: 12px;
}
.editor-grid {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
}
.editor-main,
.editor-side {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--panel);
}
.editor-main {
  min-width: 0;
}
.pin-field {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pin-field input {
  width: auto;
  margin: 0;
}
.editor-actions > button {
  flex: 1;
  min-height: 42px;
}
#vditor {
  margin-top: 8px;
  border-color: rgba(129, 147, 211, 0.28) !important;
  border-radius: 12px;
  overflow: hidden;
}
#vditor .vditor-toolbar {
  border-color: var(--line);
  background: #151c3a;
}
#vditor .vditor-toolbar__item button {
  color: #aeb9dc;
}
#vditor .vditor-content,
#vditor .vditor-reset {
  background: #0f1631;
  color: #e9edff;
}
.light #vditor .vditor-toolbar {
  background: #f4f6ff;
}
.light #vditor .vditor-content,
.light #vditor .vditor-reset {
  background: #fff;
  color: #202842;
}
.field {
  display: block;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12px;
}
.field textarea {
  resize: vertical;
}
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: rgba(255, 255, 255, 0.04);
}
.toolbar button {
  min-width: 32px;
  height: 30px;
  border: 0;
  border-radius: 7px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  cursor: pointer;
}
.editor {
  min-height: 380px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background: rgba(7, 12, 32, 0.42);
  color: var(--text);
  font-size: 16px;
  line-height: 1.8;
  outline: 0;
  overflow: auto;
}
.editor:empty:before {
  content: attr(data-placeholder);
  color: #697293;
}
.paste-hint {
  margin: 8px 0 0;
  color: #7380aa;
  font-size: 11px;
}
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.uploading {
  opacity: 0.6;
  pointer-events: none;
}
#toast {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 20;
  padding: 12px 18px;
  border: 1px solid rgba(105, 135, 255, 0.5);
  border-radius: 12px;
  background: #17234e;
  color: white;
  opacity: 0;
  transform: translateY(10px);
  transition: 0.2s;
  pointer-events: none;
}
#toast.show {
  opacity: 1;
  transform: none;
}
@media (max-width: 900px) {
  .shell {
    width: 100%;
    height: auto;
    min-height: 100vh;
    margin: 0;
    border: 0;
    border-radius: 0;
    grid-template: 64px auto 1fr/1fr;
  }
  .shell header {
    grid-column: 1;
    grid-template-columns: auto 1fr auto;
  }
  .brand {
    padding-left: 18px;
    font-size: 20px;
  }
  .search {
    width: auto;
    margin-left: 15px;
  }
  .header-actions {
    margin-right: 14px;
  }
  .mobile-admin {
    display: flex;
  }
  .shell > aside {
    grid-row: 2;
    flex-direction: row;
    align-items: center;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    overflow: auto;
  }
  .shell > aside > div:first-child {
    display: flex;
  }
  .eyebrow,
  .profile,
  .bio,
  .socials,
  .admin-link {
    display: none;
  }
  .nav-item {
    white-space: nowrap;
    margin: 0 4px;
    padding: 9px 12px;
  }
  main {
    padding: 20px;
  }
  .cards {
    grid-template-columns: 1fr;
  }
  .editor-grid {
    grid-template-columns: 1fr;
  }
  .admin {
    width: 100%;
  }
  .admin-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
  }
  .admin-row .grow {
    min-width: 0;
  }
  .admin-row .grow strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .admin-row .badge {
    align-self: start;
  }
  .admin-row .edit,
  .admin-row .del {
    min-height: 44px;
  }
  .admin-top {
    align-items: flex-start;
    gap: 12px;
  }
  .admin-top h1 {
    margin: 4px 0 0;
  }
  .admin-top .actions {
    justify-content: flex-end;
  }
  .editor-side {
    padding-bottom: max(18px, env(safe-area-inset-bottom));
  }
}
@media (max-width: 560px) {
  .shell {
    grid-template-rows: 60px auto 1fr;
  }
  .brand {
    padding-left: 12px;
    font-size: 18px;
  }
  header .search {
    height: 38px;
    margin-left: 6px;
    padding: 0 10px;
  }
  header .search span {
    display: none;
  }
  .header-actions {
    gap: 5px;
    margin-right: 8px;
  }
  .mobile-admin,
  .icon-btn {
    height: 38px;
    border-radius: 10px;
  }
  .mobile-admin {
    padding: 0 9px;
  }
  .icon-btn {
    width: 36px;
  }
  .card {
    grid-template-columns: 82px 1fr;
  }
  .card-cover {
    width: 67px;
    height: 92px;
  }
  .hero {
    padding: 22px;
  }
  .comments {
    margin-top: 44px;
  }
  .comment-form {
    padding: 15px 12px;
  }
  .comment-fields {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .comment-submit {
    width: 100%;
    min-height: 44px;
  }
  .comment {
    grid-template-columns: 36px 1fr;
    padding: 13px;
  }
  .comment-avatar {
    width: 36px;
    height: 36px;
  }
  main {
    padding: 16px 12px 28px;
  }
  .admin-top {
    flex-wrap: wrap;
  }
  .admin-top > .actions {
    width: 100%;
  }
  .admin-top > .actions button {
    flex: 1;
    min-height: 44px;
  }
  .admin-row {
    padding: 14px;
  }
  .admin-row .edit,
  .admin-row .del {
    width: 100%;
  }
  .editor-main,
  .editor-side {
    padding: 14px 12px;
    border-radius: 14px;
  }
  .editor-grid {
    gap: 12px;
  }
  .editor-page .admin-top {
    position: sticky;
    top: -16px;
    z-index: 12;
    padding: 12px 4px;
    background: rgba(9, 14, 36, 0.92);
    backdrop-filter: blur(14px);
  }
  .light .editor-page .admin-top {
    background: rgba(241, 243, 255, 0.94);
  }
  #vditor .vditor-toolbar {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }
  #vditor .vditor-toolbar::-webkit-scrollbar {
    display: none;
  }
  #toast {
    right: 12px;
    bottom: max(12px, env(safe-area-inset-bottom));
    left: 12px;
    text-align: center;
  }
}
