:root {
  color-scheme: light;
  --bg: #f7f9fc;
  --bg-deep: #191f28;
  --surface: #ffffff;
  --surface-soft: #f1f6ff;
  --surface-tint: #fbfcff;
  --text: #191f28;
  --muted: #6b7684;
  --line: #e5e8ee;
  --blue: #3182f6;
  --blue-dark: #1b64da;
  --cyan: #00c2ff;
  --lime: #00c471;
  --pink: #ff5c8a;
  --green: #00c471;
  --amber: #ffb020;
  --violet: #7c5cff;
  --red: #e5484d;
  --ink: #191f28;
  --radius-xs: 10px;
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --shadow: 0 22px 56px rgba(25, 31, 40, 0.11);
  --shadow-soft: 0 12px 30px rgba(25, 31, 40, 0.07);
  --shadow-hover: 0 28px 70px rgba(25, 31, 40, 0.14);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1019;
  --bg-deep: #05070c;
  --surface: #111827;
  --surface-soft: #182234;
  --surface-tint: #0f1724;
  --text: #f4f7fb;
  --muted: #9aa7ba;
  --line: rgba(148, 163, 184, 0.22);
  --blue: #6ea2ff;
  --blue-dark: #8bb5ff;
  --cyan: #22d3ee;
  --lime: #55e99f;
  --green: #35d6ad;
  --amber: #fbbf24;
  --violet: #a78bfa;
  --red: #fb7185;
  --ink: #f8fafc;
  --shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 14px 34px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97) 0, rgba(247, 249, 252, 0.96) 44%, #f2f5f9 100%),
    linear-gradient(120deg, rgba(49, 130, 246, 0.14) 0 18%, transparent 42%),
    linear-gradient(90deg, rgba(0, 196, 113, 0.12), rgba(255, 176, 32, 0.09), rgba(255, 92, 138, 0.06), transparent 78%);
}

.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 40;
  width: 100%;
  height: 3px;
  background: transparent;
  pointer-events: none;
}

.reading-progress span {
  display: block;
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--lime));
  transition: width 120ms linear;
}

a {
  color: inherit;
  text-decoration: none;
}

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

.shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 0 32px;
  border-bottom: 1px solid rgba(229, 232, 238, 0.8);
  background: rgba(255, 255, 255, 0.76);
  backdrop-filter: blur(24px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 820;
  letter-spacing: 0;
}

.brand-mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  font-size: 13px;
  box-shadow: 0 12px 28px rgba(49, 130, 246, 0.22);
  overflow: hidden;
}

.brand-mark::after {
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 9px;
  height: 3px;
  border-radius: 999px;
  background: #ffffff;
  content: "";
}

.nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.nav a {
  padding: 8px 12px;
  border-radius: 999px;
}

.nav a[aria-current="page"],
.nav a:hover {
  color: var(--text);
  background: #f2f5f9;
}

.nav .logout-link {
  color: var(--red);
}

.nav .logout-link:hover {
  color: #ffffff;
  background: var(--red);
}

.theme-switcher {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  min-height: 34px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.theme-switcher button {
  min-height: 26px;
  border: 0;
  border-radius: 999px;
  padding: 0 9px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 12px;
  font-weight: 760;
}

.theme-switcher button[aria-pressed="true"] {
  color: var(--ink);
  background: #ffffff;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.1);
}

.theme-switcher button:hover {
  color: var(--ink);
}

.container {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
}

.blog-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  align-items: start;
  gap: 32px;
  padding: 34px 0 78px;
}

.page-head {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 72px 0 32px;
  isolation: isolate;
}

.page-head::before {
  position: absolute;
  inset: 44px auto auto 0;
  z-index: -1;
  width: min(620px, 84vw);
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--blue), var(--lime), var(--amber), var(--pink));
  opacity: 0.95;
  content: "";
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 840;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0;
}

.page-title {
  max-width: 760px;
  color: var(--ink);
  font-size: 58px;
  line-height: 1.08;
  text-wrap: balance;
}

.page-copy {
  max-width: 700px;
  margin: 16px 0 0;
  color: var(--muted);
  line-height: 1.72;
  font-size: 17px;
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 24px;
}

.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(49, 130, 246, 0.14);
  border-radius: 999px;
  color: #1b64da;
  background: #ffffff;
  font-size: 13px;
  font-weight: 760;
  box-shadow: 0 12px 28px rgba(25, 31, 40, 0.06);
}

.hero-tags span:nth-child(2) {
  border-color: rgba(0, 196, 113, 0.22);
  color: #008f5b;
  background: rgba(0, 196, 113, 0.08);
}

.hero-tags span:nth-child(3) {
  border-color: rgba(255, 176, 32, 0.24);
  color: #a46200;
  background: rgba(255, 176, 32, 0.12);
}

.hero-summary {
  flex: 0 0 300px;
  display: grid;
  gap: 8px;
  border: 1px solid rgba(229, 232, 238, 0.92);
  border-radius: var(--radius-lg);
  padding: 10px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 44px rgba(25, 31, 40, 0.08);
  overflow: hidden;
}

.hero-summary div {
  display: grid;
  gap: 7px;
  border-radius: var(--radius-md);
  padding: 17px;
  background: linear-gradient(180deg, #ffffff, #f7faff);
}

.hero-summary div:nth-child(1) {
  background: linear-gradient(135deg, rgba(49, 130, 246, 0.12), #ffffff 58%);
}

.hero-summary div:nth-child(2) {
  background: linear-gradient(135deg, rgba(0, 196, 113, 0.12), #ffffff 58%);
}

.hero-summary div:nth-child(3) {
  background: linear-gradient(135deg, rgba(255, 92, 138, 0.12), #ffffff 58%);
}

.hero-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.hero-summary strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.35;
}

.blog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 6px;
  padding: 12px;
  border: 1px solid rgba(229, 232, 238, 0.88);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 28px rgba(25, 31, 40, 0.05);
}

.topic-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.topic-tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #566174;
  font-size: 13px;
  font-weight: 760;
}

.topic-tabs a[aria-current="page"],
.topic-tabs a:hover {
  border-color: rgba(17, 24, 39, 0.1);
  color: var(--ink);
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.topic-tabs a:nth-child(3):hover,
.topic-tabs a:nth-child(3)[aria-current="page"] {
  border-color: rgba(49, 130, 246, 0.2);
  color: #1b64da;
  background: rgba(49, 130, 246, 0.08);
}

.topic-tabs a:nth-child(4):hover,
.topic-tabs a:nth-child(4)[aria-current="page"] {
  border-color: rgba(0, 196, 113, 0.2);
  color: #008f5b;
  background: rgba(0, 196, 113, 0.08);
}

.topic-tabs a:nth-child(5):hover,
.topic-tabs a:nth-child(5)[aria-current="page"] {
  border-color: rgba(255, 176, 32, 0.24);
  color: #a46200;
  background: rgba(255, 176, 32, 0.12);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.74) inset;
}

.search-box span {
  color: #7a8495;
  font-size: 12px;
  font-weight: 820;
  text-transform: uppercase;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  outline: none;
  font-size: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.88);
  cursor: pointer;
  font-size: 14px;
  font-weight: 760;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.74) inset;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.btn.primary {
  border-color: transparent;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  box-shadow: 0 14px 30px rgba(47, 109, 246, 0.22);
}

.btn.primary:hover {
  background: var(--blue-dark);
}

.btn:hover {
  border-color: rgba(47, 109, 246, 0.34);
  transform: translateY(-1px);
}

.btn.danger {
  color: var(--red);
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.post-list {
  display: grid;
  gap: 14px;
}

.post-row,
.panel,
.comment,
.metric {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-soft);
}

.post-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 24px;
  min-height: 218px;
  padding: 30px;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(250, 252, 255, 0.92)),
    linear-gradient(135deg, rgba(49, 130, 246, 0.1), rgba(0, 196, 113, 0.08), rgba(255, 92, 138, 0.06));
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.post-list .post-row::before {
  position: absolute;
  inset: 0 0 auto;
  height: 7px;
  background: linear-gradient(90deg, var(--blue), var(--lime), var(--amber), var(--pink));
  content: "";
}

.post-list .post-row::after {
  position: absolute;
  right: 26px;
  bottom: 22px;
  width: 130px;
  height: 84px;
  border-radius: 26px;
  background:
    linear-gradient(135deg, rgba(49, 130, 246, 0.16), rgba(255, 255, 255, 0.4)),
    linear-gradient(90deg, rgba(0, 196, 113, 0.22), rgba(255, 176, 32, 0.16), rgba(255, 92, 138, 0.14));
  opacity: 0.72;
  content: "";
}

.post-row > * {
  position: relative;
  z-index: 1;
}

.post-list .post-row:hover {
  border-color: rgba(47, 109, 246, 0.35);
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.post-list .post-row .btn {
  align-self: start;
  color: var(--blue);
  background: #ffffff;
}

.post-row h2 {
  margin-top: 8px;
  color: var(--ink);
  font-size: 30px;
  line-height: 1.2;
}

.post-row p {
  max-width: 720px;
  margin: 14px 0 0;
  color: var(--muted);
  line-height: 1.72;
}

.post-stats,
.article-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: #667085;
  font-size: 13px;
  font-weight: 700;
}

.post-stats {
  margin-top: 16px;
}

.post-stats span,
.article-stats span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.post-stats span + span::before,
.article-stats span + span::before {
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #a8b2c3;
  content: "";
}

.article-meta-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.article-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.article-actions .btn {
  min-height: 32px;
  padding: 0 11px;
  font-size: 13px;
}

.post-tags,
.article-tags,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.post-tags {
  margin-top: 22px;
}

.post-tags span,
.article-tags a,
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 11px;
  border: 1px solid rgba(49, 130, 246, 0.16);
  border-radius: 999px;
  color: #1b64da;
  background: linear-gradient(180deg, #ffffff, #f3f8ff);
  font-size: 12px;
  font-weight: 820;
  box-shadow: 0 9px 18px rgba(47, 109, 246, 0.08);
}

.post-tags span:first-child,
.article-tags a:first-child,
.tag-cloud a:first-child {
  border-color: rgba(0, 196, 113, 0.3);
  color: #008f5b;
  background: rgba(0, 196, 113, 0.1);
  box-shadow: 0 12px 26px rgba(0, 196, 113, 0.14);
}

.post-tags span:nth-child(2),
.article-tags a:nth-child(2),
.tag-cloud a:nth-child(2) {
  border-color: rgba(124, 92, 255, 0.24);
  color: #5b45d6;
  background: rgba(124, 92, 255, 0.09);
}

.post-tags span:nth-child(3),
.article-tags a:nth-child(3),
.tag-cloud a:nth-child(3) {
  border-color: rgba(255, 176, 32, 0.28);
  color: #a46200;
  background: rgba(255, 176, 32, 0.12);
}

.post-tags span:nth-child(4),
.article-tags a:nth-child(4),
.tag-cloud a:nth-child(4) {
  border-color: rgba(255, 92, 138, 0.24);
  color: #c63766;
  background: rgba(255, 92, 138, 0.09);
}

.post-tags span:hover,
.article-tags a:hover,
.tag-cloud a:hover {
  border-color: rgba(17, 24, 39, 0.16);
  color: #101318;
  background: #ffffff;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.78);
  font-size: 12px;
  font-weight: 760;
}

.chip.green {
  color: #008f5b;
  border-color: rgba(0, 196, 113, 0.24);
  background: rgba(0, 196, 113, 0.1);
}

.chip.amber {
  color: #a46200;
  border-color: rgba(255, 176, 32, 0.28);
  background: rgba(255, 176, 32, 0.12);
}

.side-stack {
  display: grid;
  align-content: start;
  gap: 14px;
}

.panel {
  padding: 22px;
  backdrop-filter: blur(18px);
}

.panel h2,
.panel h3 {
  font-size: 16px;
}

.compact-panel {
  box-shadow: none;
}

.panel p,
.panel li {
  color: var(--muted);
  line-height: 1.65;
}

.article {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 48px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(252, 253, 255, 0.94)),
    linear-gradient(135deg, rgba(49, 130, 246, 0.08), rgba(0, 196, 113, 0.05));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.article h1 {
  margin-top: 10px;
  font-size: 46px;
  line-height: 1.11;
  text-wrap: balance;
}

.article-tags {
  margin: 20px 0 22px;
}

.article-meta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 28px;
  padding: 16px;
  border: 1px solid rgba(229, 232, 238, 0.9);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(247, 250, 255, 0.84)),
    linear-gradient(90deg, rgba(49, 130, 246, 0.08), rgba(0, 196, 113, 0.08), rgba(255, 176, 32, 0.07));
}

.author-row {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

.author-avatar,
.comment-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  color: #ffffff;
  background: var(--bg-deep);
  font-weight: 820;
}

.author-avatar {
  width: 38px;
  height: 38px;
  font-size: 14px;
  background: linear-gradient(135deg, var(--blue), var(--violet));
}

.author-row div {
  display: grid;
  gap: 3px;
}

.author-row strong {
  color: var(--ink);
  font-size: 14px;
}

.author-row span {
  color: var(--muted);
  font-size: 13px;
}

.article p,
.article li,
.article blockquote {
  font-size: 17px;
  line-height: 1.8;
}

.article p {
  color: #333d4b;
}

.article h2 {
  margin-top: 46px;
  font-size: 26px;
  scroll-margin-top: 92px;
}

.article blockquote {
  margin: 30px 0;
  padding: 20px 22px;
  border: 1px solid rgba(0, 196, 113, 0.18);
  border-left: 7px solid var(--lime);
  border-radius: var(--radius-md);
  color: #263244;
  background: linear-gradient(90deg, rgba(0, 196, 113, 0.12), rgba(49, 130, 246, 0.07), rgba(255, 255, 255, 0.78));
}

.post-aside {
  position: sticky;
  top: 88px;
}

.toc-panel {
  position: relative;
  padding: 18px;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(180deg, rgba(49, 130, 246, 0.32), rgba(0, 196, 113, 0.34), rgba(255, 176, 32, 0.24)) border-box;
  border-color: transparent;
  box-shadow: var(--shadow-soft);
}

.toc-panel h2 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 840;
  text-transform: uppercase;
}

.toc-list {
  display: grid;
  gap: 2px;
}

.toc-list a {
  position: relative;
  display: block;
  padding: 9px 10px 9px 16px;
  border-radius: var(--radius-sm);
  color: #3b4454;
  font-size: 14px;
  font-weight: 720;
}

.toc-list a::before {
  position: absolute;
  top: 50%;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 999px;
  background: #94a3b8;
  content: "";
  transform: translateY(-50%);
}

.toc-list a:hover {
  color: var(--blue);
  background: #f2f7ff;
}

.toc-list a:hover::before {
  background: var(--lime);
}

.category-list,
.popular-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.category-list a,
.popular-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 36px;
  padding: 10px 12px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  color: #303948;
  font-size: 14px;
  font-weight: 700;
}

.category-list a:last-child,
.popular-list a:last-child {
  border-bottom-color: transparent;
}

.category-list strong {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  border-radius: 999px;
  color: var(--blue);
  background: #eef5ff;
  font-size: 12px;
}

.popular-list a {
  justify-content: flex-start;
  line-height: 1.45;
}

.category-list a:hover,
.popular-list a:hover {
  color: var(--blue);
  border-color: rgba(49, 130, 246, 0.12);
  background: rgba(49, 130, 246, 0.06);
}

.tag-cloud {
  margin-top: 14px;
}

.compact-tags {
  gap: 7px;
}

.compact-tags a {
  min-height: 28px;
  padding: 0 10px;
}

.comments {
  display: grid;
  margin-top: 16px;
}

.comment {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 13px;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid rgba(220, 228, 239, 0.78);
  border-radius: var(--radius-md);
  box-shadow: none;
  background: transparent;
}

.comment:last-child {
  border-bottom: 0;
}

.comment-avatar {
  width: 36px;
  height: 36px;
  font-size: 13px;
  background: linear-gradient(135deg, var(--bg-deep), #2f6df6);
}

.comment--admin {
  border-left: 4px solid var(--lime);
  padding-left: 14px;
  background: linear-gradient(90deg, rgba(0, 196, 113, 0.08), transparent 56%);
}

.comment--admin > .comment-avatar {
  color: #07111f;
  background: linear-gradient(135deg, var(--lime), #7dffb6);
}

.comment-content {
  min-width: 0;
}

.comment-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 13px;
}

.comment p {
  margin: 8px 0 0;
  color: #2c3340;
  line-height: 1.65;
}

.admin-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  margin-left: 6px;
  padding: 0 7px;
  border: 1px solid rgba(0, 196, 113, 0.22);
  border-radius: 999px;
  color: #047857;
  background: rgba(0, 196, 113, 0.1);
  font-size: 11px;
  font-weight: 840;
  vertical-align: middle;
}

.comment-replies {
  display: grid;
  gap: 0;
  margin-top: 14px;
  padding-left: 16px;
  border-left: 1px solid rgba(47, 109, 246, 0.16);
}

.comment-replies .comment {
  padding-top: 14px;
  padding-bottom: 14px;
}

.comments-panel,
.comment-form-panel {
  max-width: 808px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-title-row > div {
  min-width: 0;
}

.section-title-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 760;
}

.section-title-row .notice {
  margin-top: 6px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  color: #3a4352;
  font-size: 13px;
  font-weight: 700;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 13px;
  color: var(--text);
  outline: none;
}

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

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 109, 246, 0.12);
}

.admin-shell {
  display: grid;
  grid-template-columns: 246px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.sidebar {
  padding: 22px;
  border-right: 1px solid rgba(17, 24, 39, 0.08);
  background: linear-gradient(180deg, #101318, #161b24);
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.sidebar a {
  display: flex;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.62);
  font-size: 14px;
  font-weight: 680;
}

.sidebar a[aria-current="page"],
.sidebar a:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.admin-main {
  padding: 38px 34px 72px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.92), rgba(241, 245, 249, 0.94)),
    linear-gradient(120deg, rgba(47, 109, 246, 0.09), transparent 38%),
    linear-gradient(90deg, transparent, rgba(183, 245, 61, 0.09));
}

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

.metric {
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 34px;
  line-height: 1;
}

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

.table th,
.table td {
  padding: 14px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
  font-size: 14px;
}

.table th {
  color: var(--muted);
  font-weight: 700;
}

.comments-table th:first-child,
.comments-table td:first-child {
  width: 28%;
  min-width: 220px;
}

.comment-post-cell {
  display: grid;
  gap: 5px;
}

.comment-post-cell a {
  color: var(--blue);
  font-weight: 820;
  line-height: 1.45;
  text-decoration: none;
}

.comment-post-cell a:hover {
  text-decoration: underline;
}

.comment-body-cell {
  min-width: 180px;
  max-width: 420px;
  line-height: 1.6;
}

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

.draft-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.draft-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(255, 255, 255, 0.76);
}

.draft-card-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.draft-card h3 {
  font-size: 17px;
}

.draft-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.draft-card code {
  overflow: hidden;
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.draft-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
}

.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button-row .btn {
  flex: 1 1 140px;
}

[data-tooltip] {
  position: relative;
}

[data-tooltip]::after {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  z-index: 30;
  width: max-content;
  max-width: min(280px, 72vw);
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.18);
  content: attr(data-tooltip);
  font-size: 12px;
  font-weight: 680;
  line-height: 1.45;
  opacity: 0;
  pointer-events: none;
  text-align: left;
  transform: translate(-50%, 4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  white-space: normal;
}

[data-tooltip]::before {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 4px);
  z-index: 31;
  width: 9px;
  height: 9px;
  background: rgba(15, 23, 42, 0.94);
  content: "";
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 4px) rotate(45deg);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

[data-tooltip]:hover::after,
[data-tooltip]:focus-visible::after,
[data-tooltip]:hover::before,
[data-tooltip]:focus-visible::before {
  opacity: 1;
  transform: translate(-50%, 0);
}

.editor-toolbar button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 11px;
  color: #344054;
  background: rgba(255, 255, 255, 0.86);
  cursor: pointer;
  font-size: 13px;
  font-weight: 780;
}

.editor-toolbar button:hover {
  border-color: rgba(47, 109, 246, 0.32);
  color: var(--blue);
}

.editor-area {
  min-height: 420px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.editor-preview {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.preview-surface {
  display: grid;
  gap: 12px;
  min-height: 180px;
}

.preview-surface h1 {
  font-size: 28px;
}

.preview-surface h2 {
  margin-top: 8px;
  font-size: 21px;
}

.preview-surface p,
.preview-surface li {
  color: #303642;
  line-height: 1.68;
}

.preview-surface blockquote {
  margin: 0;
  border-left: 3px solid var(--lime);
  padding: 12px 14px;
  color: #394150;
  background: #f4f7fb;
}

.preview-surface pre {
  overflow: auto;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: #0f172a;
}

.preview-surface pre code {
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre;
}

.preview-surface :not(pre) > code {
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 2px 5px;
  color: #174ec8;
  background: #eef4ff;
  font-size: 0.92em;
}

.preview-surface img {
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.preview-surface a {
  color: var(--blue);
  font-weight: 720;
}

.code-snippet {
  overflow: hidden;
  margin: 26px 0;
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--radius-lg);
  background: #0b1020;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.14);
}

.preview-surface .code-snippet {
  margin: 0;
}

.code-snippet-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  padding: 10px 12px;
  color: #cbd5e1;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.94));
  font-size: 12px;
  font-weight: 820;
}

.code-copy-button {
  min-height: 28px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 999px;
  padding: 0 10px;
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  font-size: 12px;
  font-weight: 780;
}

.code-copy-button:hover {
  border-color: rgba(183, 245, 61, 0.5);
  color: #f8fafc;
  background: rgba(183, 245, 61, 0.1);
}

.code-snippet-pre {
  overflow: auto;
  margin: 0;
  padding: 14px 0;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0 46px, transparent 46px),
    #0b1020;
}

.preview-surface .code-snippet-pre {
  border: 0;
  border-radius: 0;
  padding: 14px 0;
  background:
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 0 46px, transparent 46px),
    #0b1020;
}

.code-snippet code {
  display: block;
  min-width: max-content;
  color: #dbeafe;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.68;
  tab-size: 2;
}

.code-line {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  min-height: 22px;
}

.code-line-number {
  padding-right: 12px;
  color: #64748b;
  text-align: right;
  user-select: none;
}

.code-line-source {
  padding: 0 18px;
  white-space: pre;
}

.tok-keyword {
  color: #93c5fd;
}

.tok-string {
  color: #bef264;
}

.tok-comment {
  color: #94a3b8;
  font-style: italic;
}

.tok-number {
  color: #fbbf24;
}

.asset-helper {
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 14px;
  background: rgba(255, 255, 255, 0.68);
}

.asset-helper h3 {
  font-size: 15px;
}

.media-drop {
  display: grid;
  gap: 5px;
  border: 1px dashed rgba(47, 109, 246, 0.32);
  border-radius: var(--radius-md);
  padding: 12px;
  background: rgba(47, 109, 246, 0.05);
}

.media-drop strong {
  color: var(--blue);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.media-drop span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.media-list {
  display: grid;
  gap: 8px;
}

.media-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 10px;
  background: rgba(255, 255, 255, 0.72);
}

.media-item div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.media-item strong,
.media-item code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.media-item strong {
  color: var(--ink);
  font-size: 13px;
}

.media-item code {
  color: var(--muted);
  font-size: 12px;
}

.media-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.media-item button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 10px;
  color: var(--blue);
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 760;
}

.media-item button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.notice {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.turnstile-slot {
  min-height: 65px;
}

:root[data-theme="dark"] body {
  background:
    linear-gradient(180deg, rgba(7, 10, 17, 0.98) 0, rgba(11, 16, 25, 0.98) 46%, #0e1623 100%),
    linear-gradient(135deg, rgba(110, 162, 255, 0.18), transparent 34%),
    linear-gradient(90deg, rgba(183, 245, 61, 0.1), rgba(34, 211, 238, 0.08), transparent 72%);
}

:root[data-theme="dark"] .topbar {
  border-bottom-color: rgba(148, 163, 184, 0.18);
  background: rgba(7, 10, 17, 0.82);
}

:root[data-theme="dark"] .nav a[aria-current="page"],
:root[data-theme="dark"] .nav a:hover {
  background: rgba(148, 163, 184, 0.13);
}

:root[data-theme="dark"] .nav .logout-link {
  color: #fb7185;
}

:root[data-theme="dark"] .nav .logout-link:hover {
  color: #ffffff;
  background: rgba(251, 113, 133, 0.22);
}

:root[data-theme="dark"] .theme-switcher {
  background: rgba(15, 23, 36, 0.88);
}

:root[data-theme="dark"] .theme-switcher button[aria-pressed="true"] {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

:root[data-theme="dark"] .hero-tags span,
:root[data-theme="dark"] .topic-tabs a[aria-current="page"],
:root[data-theme="dark"] .topic-tabs a:hover,
:root[data-theme="dark"] .search-box,
:root[data-theme="dark"] .btn,
:root[data-theme="dark"] .panel,
:root[data-theme="dark"] .metric {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(17, 24, 39, 0.72);
}

:root[data-theme="dark"] .hero-tags span,
:root[data-theme="dark"] .topic-tabs a,
:root[data-theme="dark"] .search-box span,
:root[data-theme="dark"] .post-stats,
:root[data-theme="dark"] .article-stats {
  color: var(--muted);
}

:root[data-theme="dark"] .hero-summary {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.74);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .hero-summary div {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(11, 16, 25, 0.92));
}

:root[data-theme="dark"] .hero-summary div:nth-child(1) {
  background: linear-gradient(135deg, rgba(110, 162, 255, 0.16), rgba(15, 23, 42, 0.9) 62%);
}

:root[data-theme="dark"] .hero-summary div:nth-child(2) {
  background: linear-gradient(135deg, rgba(53, 214, 173, 0.16), rgba(15, 23, 42, 0.9) 62%);
}

:root[data-theme="dark"] .hero-summary div:nth-child(3) {
  background: linear-gradient(135deg, rgba(251, 113, 133, 0.15), rgba(15, 23, 42, 0.9) 62%);
}

:root[data-theme="dark"] .hero-summary strong {
  color: #f8fafc;
}

:root[data-theme="dark"] .blog-toolbar {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(15, 23, 42, 0.68);
}

:root[data-theme="dark"] .post-row {
  border-color: rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(180deg, rgba(17, 24, 39, 0.92), rgba(11, 16, 25, 0.94)),
    linear-gradient(135deg, rgba(110, 162, 255, 0.12), rgba(183, 245, 61, 0.08));
}

:root[data-theme="dark"] .post-list .post-row::after {
  opacity: 0.38;
}

:root[data-theme="dark"] .post-list .post-row .btn {
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.78);
}

:root[data-theme="dark"] .article {
  background: rgba(17, 24, 39, 0.9);
}

:root[data-theme="dark"] .article p,
:root[data-theme="dark"] .comment p {
  color: #d6deeb;
}

:root[data-theme="dark"] .comment--admin {
  background: linear-gradient(90deg, rgba(183, 245, 61, 0.1), transparent 58%);
}

:root[data-theme="dark"] .admin-badge {
  border-color: rgba(183, 245, 61, 0.28);
  color: #d9ff83;
  background: rgba(183, 245, 61, 0.1);
}

:root[data-theme="dark"] .comment-replies {
  border-left-color: rgba(110, 162, 255, 0.22);
}

:root[data-theme="dark"] .article-meta-card {
  border-color: rgba(148, 163, 184, 0.2);
  background:
    linear-gradient(180deg, rgba(15, 23, 42, 0.82), rgba(17, 24, 39, 0.78)),
    linear-gradient(90deg, rgba(110, 162, 255, 0.1), rgba(53, 214, 173, 0.08), rgba(251, 191, 36, 0.07));
}

:root[data-theme="dark"] .article blockquote {
  color: #e5eefc;
  background: linear-gradient(90deg, rgba(183, 245, 61, 0.15), rgba(110, 162, 255, 0.1));
}

:root[data-theme="dark"] .toc-panel {
  background:
    linear-gradient(rgba(17, 24, 39, 0.96), rgba(17, 24, 39, 0.96)) padding-box,
    linear-gradient(180deg, rgba(110, 162, 255, 0.42), rgba(183, 245, 61, 0.4)) border-box;
}

:root[data-theme="dark"] .toc-list a,
:root[data-theme="dark"] .category-list a,
:root[data-theme="dark"] .popular-list a {
  color: #cbd5e1;
}

:root[data-theme="dark"] .toc-list a:hover,
:root[data-theme="dark"] .category-list a:hover,
:root[data-theme="dark"] .popular-list a:hover {
  color: #dbeafe;
  background: rgba(148, 163, 184, 0.1);
}

:root[data-theme="dark"] .category-list a,
:root[data-theme="dark"] .popular-list a,
:root[data-theme="dark"] .comment {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

:root[data-theme="dark"] .category-list strong {
  background: rgba(110, 162, 255, 0.15);
}

:root[data-theme="dark"] .post-tags span,
:root[data-theme="dark"] .article-tags a,
:root[data-theme="dark"] .tag-cloud a,
:root[data-theme="dark"] .chip {
  border-color: rgba(110, 162, 255, 0.26);
  color: #cfe0ff;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.72));
}

:root[data-theme="dark"] .post-tags span:first-child,
:root[data-theme="dark"] .article-tags a:first-child,
:root[data-theme="dark"] .tag-cloud a:first-child {
  color: #07111f;
  background: linear-gradient(135deg, var(--lime), #8dffbd);
}

:root[data-theme="dark"] .post-tags span:nth-child(2),
:root[data-theme="dark"] .article-tags a:nth-child(2),
:root[data-theme="dark"] .tag-cloud a:nth-child(2) {
  border-color: rgba(167, 139, 250, 0.28);
  color: #ddd6fe;
  background: rgba(124, 92, 255, 0.14);
}

:root[data-theme="dark"] .post-tags span:nth-child(3),
:root[data-theme="dark"] .article-tags a:nth-child(3),
:root[data-theme="dark"] .tag-cloud a:nth-child(3) {
  border-color: rgba(251, 191, 36, 0.28);
  color: #fde68a;
  background: rgba(251, 191, 36, 0.12);
}

:root[data-theme="dark"] .post-tags span:nth-child(4),
:root[data-theme="dark"] .article-tags a:nth-child(4),
:root[data-theme="dark"] .tag-cloud a:nth-child(4) {
  border-color: rgba(251, 113, 133, 0.28);
  color: #fecdd3;
  background: rgba(251, 113, 133, 0.12);
}

:root[data-theme="dark"] .chip.green {
  color: #a7f3d0;
  border-color: rgba(53, 214, 173, 0.28);
  background: rgba(20, 184, 166, 0.12);
}

:root[data-theme="dark"] .chip.amber {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.12);
}

:root[data-theme="dark"] .field label {
  color: #cbd5e1;
}

:root[data-theme="dark"] .field input,
:root[data-theme="dark"] .field textarea,
:root[data-theme="dark"] .field select,
:root[data-theme="dark"] .search-box input {
  background: rgba(15, 23, 42, 0.76);
  color: var(--text);
}

:root[data-theme="dark"] .editor-toolbar button,
:root[data-theme="dark"] .editor-preview,
:root[data-theme="dark"] .asset-helper,
:root[data-theme="dark"] .draft-card,
:root[data-theme="dark"] .media-item {
  border-color: rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.66);
}

:root[data-theme="dark"] .editor-toolbar button {
  color: #cbd5e1;
}

:root[data-theme="dark"] .preview-surface p,
:root[data-theme="dark"] .preview-surface li {
  color: #d6deeb;
}

:root[data-theme="dark"] .preview-surface blockquote,
:root[data-theme="dark"] .media-drop {
  color: #e5eefc;
  background: rgba(110, 162, 255, 0.09);
}

:root[data-theme="dark"] .preview-surface :not(pre) > code {
  color: #cfe0ff;
  background: rgba(110, 162, 255, 0.14);
}

:root[data-theme="dark"] .media-item button {
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.88);
}

:root[data-theme="dark"] .field input::placeholder,
:root[data-theme="dark"] .field textarea::placeholder,
:root[data-theme="dark"] .search-box input::placeholder {
  color: #718096;
}

:root[data-theme="dark"] .admin-main {
  background:
    linear-gradient(180deg, rgba(11, 16, 25, 0.96), rgba(15, 23, 36, 0.98)),
    linear-gradient(120deg, rgba(110, 162, 255, 0.12), transparent 38%),
    linear-gradient(90deg, transparent, rgba(183, 245, 61, 0.08));
}

:root[data-theme="dark"] .metric {
  background: rgba(17, 24, 39, 0.82);
}

:root[data-theme="dark"] .table th,
:root[data-theme="dark"] .table td {
  border-bottom-color: rgba(148, 163, 184, 0.16);
}

@media (max-width: 900px) {
  .blog-layout,
  .editor-grid,
  .admin-shell,
  .metrics {
    grid-template-columns: 1fr;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.08);
  }

  .post-aside {
    position: static;
  }

  .page-head,
  .post-row {
    grid-template-columns: 1fr;
    display: grid;
  }

  .hero-summary {
    width: 100%;
  }

  .blog-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-box {
    min-width: 0;
    width: 100%;
  }

  .page-title,
  .article h1 {
    font-size: 34px;
  }

  .article-meta-card {
    align-items: flex-start;
    flex-direction: column;
  }

  .article-meta-side,
  .article-actions {
    justify-items: start;
    justify-content: flex-start;
  }

  .article {
    padding: 24px;
  }

  .post-list .post-row::after {
    display: none;
  }

  .container {
    width: min(100% - 32px, 1120px);
  }

  .topbar {
    padding: 0 16px;
  }
}
