:root {
  color-scheme: light;
  --ink: #17141f;
  --muted: #6f6979;
  --line: #ddd8e6;
  --paper: #f8f7fb;
  --surface: #ffffff;
  --surface-muted: #f0edf5;
  --surface-hover: #f3effa;
  --header-bg: rgba(248, 247, 251, 0.9);
  --green: #6d3df5;
  --green-dark: #5424df;
  --green-soft: #eee8ff;
  --coral: #e6532f;
  --coral-soft: #fff0eb;
  --gold: #0b8e9e;
  --accent: #6d3df5;
  --accent-2: #f05a28;
  --accent-3: #0b8e9e;
  --button-bg: #6d3df5;
  --button-fg: #ffffff;
  --code-bg: #151515;
  --code-fg: #eeeeee;
  --code-muted: #9a9a9a;
  --syntax-comment: #8b949e;
  --syntax-keyword: #ff7b72;
  --syntax-string: #a5d6ff;
  --syntax-number: #79c0ff;
  --syntax-title: #d2a8ff;
  --syntax-attribute: #7ee787;
  --syntax-built-in: #ffa657;
  --danger: #c43f2b;
  --danger-bg: #fff0eb;
  --shadow: 0 18px 50px rgba(54, 36, 94, 0.12);
  --shell: 1120px;
  --reading: 740px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f7f5ff;
  --muted: #aaa3b8;
  --line: #332c42;
  --paper: #0d0b12;
  --surface: #15111d;
  --surface-muted: #1d1728;
  --surface-hover: #251e32;
  --header-bg: rgba(13, 11, 18, 0.88);
  --green: #a78bfa;
  --green-dark: #c4b5fd;
  --green-soft: #2a2042;
  --coral: #ff7a45;
  --coral-soft: #321c1a;
  --gold: #3dd7e5;
  --accent: #a78bfa;
  --accent-2: #ff7a45;
  --accent-3: #3dd7e5;
  --button-bg: #8b5cf6;
  --button-fg: #ffffff;
  --code-bg: #080808;
  --code-fg: #ededed;
  --code-muted: #909090;
  --danger: #ff8f70;
  --danger-bg: #321c1a;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

body,
.site-header,
.admin-header,
.site-footer,
.comments-section,
input,
textarea,
select {
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

button,
input,
textarea,
select {
  font: inherit;
  letter-spacing: 0;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

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

button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

::selection {
  background: var(--ink);
  color: var(--paper);
}

img {
  display: block;
  max-width: 100%;
}

.shell {
  width: min(calc(100% - 40px), var(--shell));
  margin-inline: auto;
}

.shell-reading {
  width: min(calc(100% - 40px), var(--reading));
  margin-inline: auto;
}

.site-header,
.admin-header {
  position: relative;
  z-index: 20;
  min-height: 72px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.header-inner {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  font-weight: 700;
}

.brand > span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--button-bg);
  color: var(--button-fg);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
}

.site-nav,
.admin-nav {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.site-nav a:hover,
.admin-nav a:hover,
.link-button:hover {
  color: var(--green);
}

.admin-nav form {
  margin: 0;
}

.link-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 650;
}

.theme-toggle {
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

.theme-toggle:hover {
  background: var(--surface-hover);
}

.theme-toggle svg {
  width: 17px;
  height: 17px;
  grid-area: 1 / 1;
}

.theme-icon-sun,
[data-theme="dark"] .theme-icon-moon {
  display: none;
}

[data-theme="dark"] .theme-icon-sun {
  display: block;
}

.home-intro {
  padding-block: 88px 76px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.home-intro-inner {
  display: grid;
  gap: 18px;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0;
}

.home-intro h1 {
  max-width: 780px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 68px;
  font-weight: 500;
  line-height: 1;
  overflow-wrap: anywhere;
}

.home-intro-inner > p:not(.eyebrow) {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  font-size: 18px;
}

.article-section {
  padding-block: 72px 120px;
}

.category-tabs {
  display: flex;
  gap: 26px;
  margin-top: 22px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.category-tabs a {
  padding: 10px 1px 9px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.category-tabs a.active {
  border-color: var(--green);
  color: var(--green);
}

.category-tabs span {
  margin-left: 3px;
  color: var(--muted);
  font-size: 11px;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 32px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--ink);
}

.section-heading h2,
.admin-section-heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  font-weight: 500;
  line-height: 1.1;
}

.section-heading > p,
.section-heading > span {
  max-width: 370px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.section-heading.compact h2 {
  font-size: 34px;
}

.article-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(0, 3fr);
  gap: 56px;
  padding-block: 40px;
  border-bottom: 1px solid var(--line);
}

.article-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--muted);
  font-size: 13px;
}

.article-summary h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 31px;
  font-weight: 500;
  line-height: 1.25;
}

.article-summary h3 a:hover {
  color: var(--green);
}

.article-summary p {
  max-width: 680px;
  margin: 14px 0;
  color: var(--muted);
}

.read-more {
  color: var(--green);
  font-size: 14px;
  font-weight: 750;
}

.empty-state {
  padding: 72px 24px;
  text-align: center;
}

.empty-state h3 {
  margin: 0 0 8px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
}

.footer-inner {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.footer-links a {
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 4px;
}

.footer-links a:hover {
  color: var(--ink);
}

.post {
  padding-block: 72px 96px;
}

.back-link {
  color: var(--green);
  font-size: 13px;
  font-weight: 750;
}

.post-header .eyebrow {
  margin-top: 46px;
}

.post-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 70px);
  font-weight: 500;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

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

.post-deck {
  margin: 38px 0 0;
  padding-left: 24px;
  border-left: 3px solid var(--ink);
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 22px;
  line-height: 1.55;
}

.post-body {
  width: min(calc(100% - 40px), 1260px);
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(0, 740px) minmax(180px, 220px);
  gap: 40px;
  align-items: start;
  margin: 64px auto 0;
}

.post-body.without-toc {
  width: min(calc(100% - 40px), var(--reading));
  display: block;
}

.article-toc {
  position: sticky;
  top: 24px;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  font-family: Inter, ui-sans-serif, sans-serif;
  scrollbar-width: thin;
}

.article-toc details > summary {
  margin-bottom: 14px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  list-style-position: inside;
}

.article-toc nav {
  display: grid;
  gap: 2px;
  padding-left: 12px;
  border-left: 1px solid var(--line);
}

.article-toc a {
  padding: 5px 8px;
  border-radius: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.article-toc a:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.article-toc .toc-level-2 {
  padding-left: 18px;
}

.article-toc .toc-level-3 {
  padding-left: 28px;
}

.article-toc .toc-level-4 {
  padding-left: 38px;
}

.mobile-toc-trigger,
.mobile-toc-dialog {
  display: none;
}

.prose {
  grid-column: 2;
  min-width: 0;
  margin-top: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  margin: 2em 0 0.7em;
  color: var(--ink);
  line-height: 1.3;
  scroll-margin-top: 24px;
}

.prose h1 {
  font-size: 38px;
}

.prose h2 {
  font-size: 32px;
}

.prose h3 {
  font-size: 25px;
}

.prose a {
  color: var(--green);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.prose img {
  height: auto;
}

.prose img[data-align="left"] {
  margin-right: auto;
}

.prose img[data-align="center"] {
  margin-inline: auto;
}

.prose img[data-align="right"] {
  margin-left: auto;
}

.prose blockquote {
  margin: 2em 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--gold);
  color: var(--muted);
}

.prose :not(pre) > code {
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--surface-muted);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.prose pre {
  position: relative;
  max-width: 100%;
  overflow-x: auto;
  padding: 24px 48px 24px 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--code-bg);
  color: var(--code-fg);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.6;
  tab-size: 2;
}

.prose pre code {
  display: block;
  width: max-content;
  min-width: 100%;
  padding: 0;
  background: transparent;
  color: inherit;
  font-family: inherit;
  font-size: inherit;
  font-variant-ligatures: none;
  white-space: pre;
}

.code-copy {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid #3c3c3c;
  border-radius: 4px;
  background: #202020;
  color: #bdbdbd;
  cursor: pointer;
}

.code-copy:hover,
.code-copy.copied {
  border-color: #686868;
  color: #ffffff;
}

.code-copy svg {
  width: 15px;
  height: 15px;
}

.hljs-comment,
.hljs-quote,
.hljs-doctag {
  color: var(--syntax-comment);
  font-style: italic;
}

.hljs-keyword,
.hljs-formula,
.hljs-selector-tag,
.hljs-deletion {
  color: var(--syntax-keyword);
  font-weight: 700;
}

.hljs-title,
.hljs-title.class_,
.hljs-title.class_.inherited__,
.hljs-title.function_,
.hljs-section,
.hljs-name,
.hljs-selector-id,
.hljs-selector-class {
  color: var(--syntax-title);
}

.hljs-string,
.hljs-regexp,
.hljs-addition,
.hljs-meta .hljs-string {
  color: var(--syntax-string);
}

.hljs-number,
.hljs-literal,
.hljs-variable,
.hljs-template-variable,
.hljs-link {
  color: var(--syntax-number);
}

.hljs-type,
.hljs-params,
.hljs-property,
.hljs-attribute,
.hljs-attr,
.hljs-selector-attr,
.hljs-selector-pseudo {
  color: var(--syntax-attribute);
}

.hljs-built_in,
.hljs-symbol,
.hljs-bullet {
  color: var(--syntax-built-in);
}

.hljs-meta,
.hljs-meta .hljs-keyword {
  color: var(--syntax-built-in);
}

.hljs-subst {
  color: var(--code-fg);
}

.hljs-emphasis {
  font-style: italic;
}

.hljs-strong {
  font-weight: 700;
}

.hljs-char.escape_,
.hljs-code,
.hljs-template-tag {
  color: var(--syntax-number);
}

.prose table {
  max-width: 100%;
  display: block;
  overflow-x: auto;
  width: 100%;
  border-collapse: collapse;
  font-family: Inter, sans-serif;
  font-size: 14px;
}

.prose th,
.prose td {
  padding: 10px 12px;
  border: 1px solid var(--line);
  text-align: left;
}

.comments-section {
  padding-block: 72px 96px;
  background: var(--surface-muted);
}

.comment-list {
  margin-block: 24px 48px;
}

.comment {
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.comment header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.comment time {
  color: var(--muted);
  font-size: 12px;
}

.comment p {
  margin: 8px 0 0;
  white-space: pre-wrap;
}

.comment-form {
  margin-top: 48px;
}

.comment-form h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.form-note {
  margin: 4px 0 24px;
  color: var(--muted);
  font-size: 13px;
}

label {
  display: block;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

label > span {
  display: block;
  margin-bottom: 7px;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  background: var(--surface);
  color: var(--ink);
}

input,
select {
  min-height: 44px;
  padding: 9px 12px;
}

textarea {
  display: block;
  padding: 12px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(128, 128, 128, 0.16);
}

.form-grid {
  display: grid;
  gap: 18px;
  margin-bottom: 18px;
}

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

.comment-form > label {
  margin-bottom: 20px;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
}

.button svg {
  width: 16px;
  height: 16px;
  margin-right: 7px;
}

.button.primary {
  background: var(--button-bg);
  color: var(--button-fg);
}

.button.primary:hover {
  background: var(--green-dark);
  color: var(--button-fg);
}

.button.secondary {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.button.danger {
  border-color: var(--line);
  background: var(--danger-bg);
  color: var(--danger);
}

.button.full {
  width: 100%;
}

.notice {
  margin-block: 20px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 5px;
  font-size: 14px;
}

.notice-success {
  border-color: var(--line);
  background: var(--green-soft);
  color: var(--ink);
}

.notice-error {
  border-color: var(--line);
  background: var(--coral-soft);
  color: var(--danger);
}

.auth-page {
  min-height: calc(100vh - 86px);
  display: grid;
  grid-template-columns: minmax(320px, 480px) 1fr;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(40px, 8vw, 96px);
  background: var(--paper);
}

.auth-brand {
  position: absolute;
  top: 30px;
}

.auth-panel h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 45px;
  font-weight: 500;
  line-height: 1.1;
}

.auth-copy {
  margin: 12px 0 32px;
  color: var(--muted);
}

.auth-panel form {
  display: grid;
  gap: 20px;
}

.auth-panel > .back-link {
  margin-top: 30px;
}

.auth-visual {
  min-height: 600px;
  overflow: hidden;
  background: var(--surface-muted);
}

.auth-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1);
}

.auth-theme {
  position: absolute;
  top: 28px;
  right: 28px;
}

.admin-main {
  min-height: calc(100vh - 159px);
  padding-block: 52px 96px;
}

.admin-titlebar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.admin-titlebar h1,
.editor-toolbar h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 39px;
  font-weight: 500;
  line-height: 1.15;
}

.admin-titlebar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-block: 1px solid var(--line);
}

.stats > div,
.stats > a {
  display: flex;
  flex-direction: column;
  padding: 25px 28px;
  border-right: 1px solid var(--line);
}

.stats > :last-child {
  border-right: 0;
}

.stats strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1;
}

.stats span {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.stats a:hover {
  background: var(--green-soft);
}

.admin-section {
  margin-top: 50px;
}

.admin-section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.admin-section-heading h2 {
  font-size: 28px;
}

.admin-section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow-x: auto;
  border-block: 1px solid var(--line);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: left;
}

th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-hover);
}

.table-title {
  display: block;
  font-weight: 700;
}

.table-sub {
  display: block;
  max-width: 360px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 750;
}

.status-published {
  background: var(--green-soft);
  color: var(--ink);
}

.status-draft {
  background: var(--surface-muted);
  color: var(--muted);
}

.table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 4px;
  color: var(--muted);
}

.icon-button:hover {
  background: var(--green-soft);
  color: var(--green);
}

.icon-button svg {
  width: 17px;
  height: 17px;
}

.admin-empty {
  border-block: 1px solid var(--line);
}

.editor-main {
  min-height: calc(100vh - 159px);
  padding-bottom: 96px;
}

.editor-toolbar {
  min-height: 118px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.editor-toolbar .back-link {
  display: block;
  margin-bottom: 5px;
}

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

.status-select select {
  min-width: 145px;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 56px;
  align-items: start;
}

.editor-fields {
  min-width: 0;
}

.editor-fields > label {
  margin-bottom: 20px;
}

.title-field input {
  min-height: 62px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 36px;
}

.title-field input:focus {
  border-color: var(--green);
  box-shadow: none;
}

.slug-field {
  display: flex;
  align-items: center;
  margin: 10px 0 24px;
  color: var(--muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
}

.slug-field input {
  min-height: 34px;
  padding: 5px 7px;
  border: 0;
  background: transparent;
  font-family: inherit;
}

.markdown-label {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.markdown-label > label {
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.markdown-label > span {
  color: var(--muted);
  font-size: 12px;
}

.editor-source {
  min-height: 590px;
  padding: 20px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 14px;
  line-height: 1.7;
}

.editor-payload {
  display: none;
}

.tiptap-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--surface);
}

.tiptap-toolbar {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
  scrollbar-width: thin;
}

.tiptap-toolbar-group {
  flex: 0 0 auto;
  display: flex;
  gap: 2px;
  padding-right: 6px;
  margin-right: 4px;
  border-right: 1px solid var(--line);
}

.tiptap-toolbar-group:last-child {
  padding-right: 0;
  margin-right: 0;
  border-right: 0;
}

.tiptap-history {
  margin-left: auto;
}

.tiptap-toolbar button {
  width: 34px;
  height: 34px;
  display: grid;
  flex: 0 0 34px;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 4px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tiptap-toolbar button:hover,
.tiptap-toolbar button.is-active {
  border-color: var(--line);
  background: var(--surface);
  color: var(--ink);
}

.tiptap-toolbar button:disabled {
  opacity: 0.32;
  cursor: default;
}

.tiptap-toolbar button svg {
  width: 17px;
  height: 17px;
}

#editor-upload-status {
  min-height: 18px;
  color: var(--muted);
  font-weight: 500;
}

#editor-upload-status.is-error {
  color: var(--danger);
}

#tiptap-editor {
  background: var(--surface);
  color: var(--ink);
}

.tiptap-content {
  min-height: 590px;
  padding: 28px 30px 80px;
  outline: none;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
}

.tiptap-content > *:first-child {
  margin-top: 0;
}

.tiptap-content p.is-editor-empty:first-child::before {
  height: 0;
  float: left;
  color: var(--muted);
  content: attr(data-placeholder);
  pointer-events: none;
}

.tiptap-content h2,
.tiptap-content h3 {
  margin: 1.8em 0 0.6em;
  line-height: 1.3;
}

.tiptap-content blockquote {
  margin: 1.5em 0;
  padding-left: 18px;
  border-left: 3px solid var(--line);
  color: var(--muted);
}

.tiptap-content pre {
  overflow-x: auto;
  padding: 18px;
  border-radius: 5px;
  background: var(--code-bg);
  color: var(--code-fg);
  font: 14px/1.65 ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-variant-ligatures: none;
  white-space: pre;
}

.tiptap-content pre code {
  display: block;
  width: max-content;
  min-width: 100%;
  font: inherit;
  white-space: pre;
}

.tiptap-content :not(pre) > code {
  padding: 2px 5px;
  border-radius: 3px;
  background: var(--surface-muted);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 0.88em;
}

.tiptap-content a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tiptap-content img,
.tiptap-content [data-resize-container] {
  max-width: 100%;
}

.tiptap-content img {
  height: auto;
  cursor: grab;
}

.tiptap-content img[data-align="left"] {
  margin-right: auto;
}

.tiptap-content img[data-align="center"] {
  margin-inline: auto;
}

.tiptap-content img[data-align="right"] {
  margin-left: auto;
}

.tiptap-content [data-resize-container]:has(img[data-align="left"]) {
  justify-content: flex-start;
}

.tiptap-content [data-resize-container]:has(img[data-align="center"]) {
  justify-content: center;
}

.tiptap-content [data-resize-container]:has(img[data-align="right"]) {
  justify-content: flex-end;
}

.tiptap-content [data-resize-wrapper] {
  max-width: 100%;
  line-height: 0;
}

.tiptap-content [data-resize-container][data-resize-state="true"] img,
.tiptap-content .ProseMirror-selectednode img {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.tiptap-content [data-resize-handle] {
  width: 10px;
  height: 10px;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.tiptap-content .tableWrapper {
  overflow-x: auto;
  margin: 1.5em 0;
}

.tiptap-content table {
  width: 100%;
  border-collapse: collapse;
  font-family: Inter, sans-serif;
  font-size: 14px;
}

.tiptap-content th,
.tiptap-content td {
  position: relative;
  min-width: 90px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  vertical-align: top;
}

.tiptap-content th {
  background: var(--surface-muted);
  text-align: left;
}

.tiptap-content .selectedCell::after {
  position: absolute;
  inset: 0;
  background: rgba(128, 128, 128, 0.16);
  content: "";
  pointer-events: none;
}

.editor-sidebar {
  position: sticky;
  top: 24px;
}

.sidebar-section {
  padding-block: 20px;
  border-bottom: 1px solid var(--line);
}

.sidebar-section:first-child {
  padding-top: 0;
}

.sidebar-section h2 {
  margin: 0 0 10px;
  font-size: 13px;
}

.sidebar-section p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.sidebar-section dl {
  margin: 0;
}

.sidebar-section dl > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 8px;
  font-size: 12px;
}

.sidebar-section dt {
  color: var(--muted);
}

.danger-zone .button {
  margin-top: 14px;
}

.settings-section {
  max-width: 620px;
  margin-top: 16px;
}

.settings-section h2 {
  margin: 0 0 22px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
}

.settings-section form {
  display: grid;
  gap: 20px;
}

.settings-section .button {
  justify-self: start;
}

.import-section .form-note {
  margin: -8px 0 0;
}

.category-admin-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

.category-admin-layout .admin-section {
  margin-top: 16px;
}

.category-create {
  position: sticky;
  top: 24px;
}

.category-create h2 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 27px;
  font-weight: 500;
}

.category-create form {
  display: grid;
  gap: 17px;
}

.category-admin-list {
  border-top: 1px solid var(--line);
}

.category-admin-list article {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.category-admin-list article > div {
  min-width: 0;
}

.category-admin-list strong,
.category-admin-list span {
  display: block;
}

.category-admin-list span {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.filter-tabs a {
  padding: 9px 1px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.filter-tabs a.active {
  border-color: var(--green);
  color: var(--green);
}

.moderation-list {
  border-top: 1px solid var(--line);
}

.moderation-item {
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}

.moderation-meta,
.moderation-item footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.moderation-meta > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.moderation-meta span,
.moderation-meta time {
  color: var(--muted);
  font-size: 12px;
}

.moderation-item > p {
  max-width: 760px;
  margin: 15px 0 18px;
  white-space: pre-wrap;
}

.moderation-item footer > a {
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.moderation-item footer form {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.text-action {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
}

.text-action.approve {
  color: var(--green);
}

.text-action.reject {
  color: var(--coral);
}

.error-page {
  min-height: calc(100vh - 159px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding-block: 80px;
}

.error-page h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(42px, 7vw, 78px);
  font-weight: 500;
}

.error-page > p:not(.eyebrow) {
  max-width: 540px;
  margin: 15px 0 28px;
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1300px) {
  .post-body {
    width: min(calc(100% - 40px), 980px);
    grid-template-columns: 200px minmax(0, 740px);
  }
}

@media (max-width: 960px) {
  .post-body {
    width: min(calc(100% - 40px), var(--reading));
    display: block;
  }

  .article-toc {
    position: static;
    max-height: none;
    margin-bottom: 48px;
  }

  .editor-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .editor-sidebar {
    position: static;
  }
}

@media (max-width: 760px) {
  .shell,
  .shell-reading {
    width: min(calc(100% - 28px), var(--shell));
  }

  .post-body {
    width: min(calc(100% - 28px), var(--reading));
    margin-top: 48px;
  }

  .site-nav {
    flex: 0 0 auto;
    gap: 12px;
  }

  .site-nav > a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .site-header .header-inner {
    gap: 12px;
  }

  .site-header .brand > span:last-child {
    max-width: min(38vw, 150px);
  }

  .theme-toggle {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .admin-header .header-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding-top: 7px;
  }

  .admin-header .brand {
    min-height: 42px;
  }

  .admin-header .brand > span:last-child {
    max-width: calc(100vw - 78px);
  }

  .admin-nav {
    width: 100%;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 7px;
    font-size: 12px;
    scrollbar-width: none;
    white-space: nowrap;
  }

  .admin-nav::-webkit-scrollbar,
  .category-tabs::-webkit-scrollbar,
  .filter-tabs::-webkit-scrollbar {
    display: none;
  }

  .admin-nav > a,
  .admin-nav .link-button {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
  }

  .admin-nav form {
    flex: 0 0 auto;
  }

  .home-intro {
    padding-block: 62px 54px;
  }

  .home-intro h1 {
    font-size: 44px;
  }

  .home-intro-inner > p:not(.eyebrow) {
    font-size: 17px;
  }

  .article-section {
    padding-block: 64px 80px;
  }

  .section-heading {
    display: block;
  }

  .section-heading h2 {
    font-size: 34px;
  }

  .section-heading > p,
  .section-heading > span {
    margin-top: 12px;
  }

  .article-row {
    grid-template-columns: 1fr;
    gap: 15px;
    padding-block: 30px;
  }

  .article-meta {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 16px;
  }

  .article-summary h3 {
    font-size: 26px;
  }

  .footer-inner {
    min-height: 100px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 2px;
  }

  .footer-links {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .post {
    padding-block: 46px 72px;
  }

  .post-header h1 {
    font-size: 38px;
  }

  .post-deck {
    margin-top: 30px;
    padding-left: 16px;
    font-size: 19px;
  }

  .prose {
    margin-top: 0;
    font-size: 17px;
  }

  .article-toc {
    margin-bottom: 32px;
  }

  .prose h1 {
    font-size: 31px;
  }

  .prose h2 {
    font-size: 27px;
  }

  .prose h3 {
    font-size: 23px;
  }

  .prose blockquote {
    padding-left: 16px;
  }

  .prose pre {
    padding: 18px 44px 18px 16px;
    font-size: 13px;
  }

  .prose th,
  .prose td {
    min-width: 110px;
    padding: 9px 10px;
  }

  .comments-section {
    padding-block: 56px 72px;
  }

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

  .comment-form .button {
    width: 100%;
  }

  .auth-page {
    min-height: calc(100vh - 100px);
    grid-template-columns: 1fr;
  }

  .auth-panel {
    min-height: 620px;
    padding: 80px 28px 46px;
  }

  .auth-brand {
    top: 22px;
  }

  .auth-panel h1 {
    font-size: 38px;
  }

  .auth-visual {
    display: none;
  }

  .admin-main {
    padding-block: 38px 72px;
  }

  .admin-titlebar {
    align-items: flex-start;
    flex-direction: column;
  }

  .admin-titlebar-actions {
    width: 100%;
  }

  .admin-titlebar-actions .button {
    flex: 1;
  }

  .admin-titlebar h1,
  .editor-toolbar h1 {
    font-size: 32px;
  }

  .stats > div,
  .stats > a {
    padding: 20px 14px;
  }

  .stats strong {
    font-size: 29px;
  }

  .table-wrap table {
    table-layout: fixed;
  }

  th:nth-child(2),
  td:nth-child(2),
  th:nth-child(4),
  td:nth-child(4),
  th:nth-child(5),
  td:nth-child(5) {
    display: none;
  }

  .table-wrap th,
  .table-wrap td {
    padding-inline: 8px;
  }

  .table-wrap th:nth-child(3),
  .table-wrap td:nth-child(3) {
    width: 70px;
  }

  .table-wrap th:last-child,
  .table-wrap td:last-child {
    width: 78px;
  }

  .table-title {
    overflow-wrap: anywhere;
  }

  .editor-toolbar {
    min-height: 150px;
    align-items: flex-start;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
  }

  .toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .toolbar-actions > * {
    min-width: 0;
  }

  .status-select select {
    min-width: 0;
  }

  .editor-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .title-field input {
    font-size: 30px;
  }

  .slug-field input {
    min-width: 0;
  }

  .markdown-label {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding-block: 8px;
  }

  .tiptap-toolbar {
    min-height: 54px;
  }

  .tiptap-toolbar button {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .tiptap-content {
    min-height: 480px;
    padding: 22px 18px 64px;
  }

  .editor-sidebar {
    position: static;
  }

  .sidebar-section dl > div {
    flex-wrap: wrap;
  }

  .category-admin-layout {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .category-create {
    position: static;
  }

  .category-admin-list span,
  .moderation-meta span,
  .moderation-item footer > a {
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .filter-tabs {
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: none;
  }

  .moderation-meta,
  .moderation-item footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .home-intro h1 {
    font-size: 40px;
  }

  .post-header h1 {
    font-size: 35px;
  }

  .stats > div,
  .stats > a {
    padding-inline: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}

/* Standalone tools workspace */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.tools-app {
  min-height: 100vh;
  background:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    var(--paper);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.tools-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.tools-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 800;
}

.tools-brand-mark,
.tools-title-icon {
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
}

.tools-brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.tools-brand-mark svg {
  width: 17px;
}

.tools-header-actions,
.tools-output-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tools-icon-button {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}

.tools-icon-button:hover {
  background: var(--surface-hover);
  color: var(--ink);
}

.tools-icon-button svg {
  width: 17px;
  height: 17px;
}

.tools-shell {
  width: min(100%, 1440px);
  min-height: calc(100vh - 60px);
  display: grid;
  grid-template-columns: 276px minmax(0, 1fr);
  margin: 0 auto;
  background: color-mix(in srgb, var(--paper) 93%, transparent);
  border-inline: 1px solid var(--line);
}

.tools-sidebar {
  min-width: 0;
  padding: 28px 18px 48px;
  border-right: 1px solid var(--line);
  background: var(--surface);
}

.tools-sidebar-heading {
  padding: 0 8px 20px;
}

.tools-sidebar-heading .eyebrow,
.tools-workspace-header .eyebrow {
  margin: 0 0 7px;
}

.tools-sidebar-heading h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1.1;
}

.tools-search,
.tools-command-input {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--paper);
}

.tools-search {
  height: 40px;
  margin-bottom: 26px;
  padding: 0 10px;
  border-radius: 6px;
}

.tools-search svg,
.tools-command-input svg {
  width: 16px;
  flex: 0 0 16px;
  color: var(--muted);
}

.tools-search input,
.tools-command-input input {
  min-width: 0;
  flex: 1;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 13px;
}

.tools-search kbd,
.tools-command-input kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: 10px;
}

.tools-nav-group + .tools-nav-group {
  margin-top: 24px;
}

.tools-nav-group h2 {
  margin: 0 8px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.tools-nav-group button {
  width: 100%;
  min-height: 38px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 650;
}

.tools-nav-group button:hover,
.tools-nav-group button.active {
  background: var(--green-soft);
  color: var(--green);
}

.tools-nav-group button > svg {
  width: 17px;
}

.tools-nav-arrow {
  opacity: 0;
}

.tools-nav-group button.active .tools-nav-arrow,
.tools-nav-group button:hover .tools-nav-arrow {
  opacity: 1;
}

.tools-no-results {
  padding: 18px 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.tools-workspace {
  min-width: 0;
  padding: 56px clamp(24px, 5vw, 72px) 80px;
  scroll-margin-top: 72px;
}

.tools-workspace-header {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  margin: 0 0 32px;
}

.tools-title-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
  background: var(--button-bg);
  color: var(--button-fg);
}

.tools-title-icon svg {
  width: 25px;
  height: 25px;
}

.tools-workspace-header h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 43px);
  font-weight: 500;
  line-height: 1.05;
}

.tools-workspace-header p:last-child {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.tools-editor {
  min-width: 0;
}

.tools-controls {
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

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

.tools-editor-grid,
.tools-card-layout {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.tools-pane,
.tools-wechat-preview,
.tools-log-summary,
.tools-visual-output {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.tools-pane-title {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 8px 6px 14px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.tools-pane-title > div {
  display: flex;
  align-items: center;
}

.tools-count {
  margin-right: 4px;
  font-size: 10px;
  font-weight: 500;
}

.tools-pane textarea {
  width: 100%;
  min-height: 410px;
  display: block;
  resize: vertical;
  padding: 18px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  line-height: 1.7;
  tab-size: 2;
}

.tools-single-editor .tools-pane textarea {
  min-height: 440px;
}

.tools-field,
.tools-select,
.tools-range {
  min-width: 0;
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.tools-field input,
.tools-select select {
  width: 100%;
  height: 40px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 13px;
}

.tools-field input:focus,
.tools-select select:focus,
.tools-pane textarea:focus {
  box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--green) 60%, transparent);
}

.tools-inline-options {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.tools-control-grid + .tools-inline-options,
.tools-controls > .tools-inline-options + .tools-inline-options {
  margin-top: 12px;
}

.tools-check {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--paper);
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 650;
}

.tools-check input {
  accent-color: var(--green);
}

.tools-segmented {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
}

.tools-segmented label {
  position: relative;
  cursor: pointer;
}

.tools-segmented input {
  position: absolute;
  opacity: 0;
}

.tools-segmented span {
  min-height: 31px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 12px;
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.tools-segmented input:checked + span {
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(20, 14, 32, 0.11);
  color: var(--ink);
}

.tools-status {
  min-height: 30px;
  padding: 8px 2px 0;
  color: var(--green);
  font-size: 12px;
}

.tools-status.is-error {
  color: var(--danger);
}

.tools-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.tools-stats > div {
  min-width: 0;
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 14px;
  border-right: 1px solid var(--line);
}

.tools-stats > div:last-child {
  border-right: 0;
}

.tools-stats strong {
  overflow: hidden;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 500;
  line-height: 1;
  text-overflow: ellipsis;
}

.tools-stats span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.tools-range input {
  width: 100%;
  accent-color: var(--green);
}

.tools-password-output {
  min-height: 86px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px 42px;
  align-items: center;
  gap: 4px;
  padding: 14px 10px 14px 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.tools-password-output output {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(16px, 2.4vw, 22px);
}

.tools-network-address {
  min-height: 138px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 28px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.tools-network-address > div:first-child {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.tools-network-address span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.tools-network-address output {
  overflow-wrap: anywhere;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: clamp(24px, 4.5vw, 42px);
  font-weight: 650;
  line-height: 1.2;
}

.tools-probe-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.tools-probe-form .button {
  min-height: 40px;
  white-space: nowrap;
}

.tools-probe-form .button.is-loading svg {
  animation: tools-spin 900ms linear infinite;
}

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

.tools-probe-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.tools-probe-card > header {
  min-height: 60px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.tools-probe-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-muted);
  color: var(--muted);
}

.tools-probe-icon svg {
  width: 17px;
}

.tools-probe-card header strong {
  font-size: 13px;
}

.tools-probe-badge {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 750;
}

.tools-probe-card.is-success .tools-probe-icon,
.tools-probe-card.is-success .tools-probe-badge {
  border-color: color-mix(in srgb, var(--accent-3) 35%, var(--line));
  background: color-mix(in srgb, var(--accent-3) 12%, var(--surface));
  color: var(--accent-3);
}

.tools-probe-card.is-warning .tools-probe-icon,
.tools-probe-card.is-warning .tools-probe-badge {
  border-color: color-mix(in srgb, var(--accent-2) 35%, var(--line));
  background: color-mix(in srgb, var(--accent-2) 12%, var(--surface));
  color: var(--accent-2);
}

.tools-probe-card.is-error .tools-probe-icon,
.tools-probe-card.is-error .tools-probe-badge {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: var(--danger-bg);
  color: var(--danger);
}

.tools-probe-card.is-pending .tools-probe-icon svg {
  animation: tools-pulse 1s ease-in-out infinite;
}

.tools-probe-card dl {
  margin: 0;
}

.tools-probe-card dl > div {
  min-height: 48px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
}

.tools-probe-card dl > div:last-child {
  border-bottom: 0;
}

.tools-probe-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.tools-probe-card dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-probe-card > p {
  margin: 0;
  padding: 10px 14px;
  border-top: 1px solid color-mix(in srgb, var(--danger) 20%, var(--line));
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 11px;
}

@keyframes tools-spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes tools-pulse {
  50% {
    opacity: 0.35;
  }
}

.tools-visual-output {
  display: grid;
  place-items: center;
  gap: 18px;
  padding: 36px;
}

.tools-visual-output canvas {
  width: min(100%, 320px);
  height: auto;
  border: 1px solid var(--line);
}

.tools-output-actions {
  justify-content: flex-end;
  margin-top: 14px;
}

.tools-card-layout .tools-pane textarea {
  min-height: 500px;
}

.tools-canvas-wrap {
  min-width: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.tools-canvas-wrap canvas {
  width: min(100%, 500px);
  height: auto;
  box-shadow: var(--shadow);
}

.tools-wechat-preview article {
  min-height: 500px;
  padding: 24px;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.8;
}

.tools-wechat-preview article h1,
.tools-wechat-preview article h2,
.tools-wechat-preview article h3 {
  margin: 1.4em 0 0.6em;
  color: var(--green);
  line-height: 1.35;
}

.tools-wechat-preview article blockquote {
  margin: 1em 0;
  padding: 10px 14px;
  border-left: 3px solid var(--green);
  background: var(--green-soft);
}

.tools-wechat-preview article code {
  padding: 2px 5px;
  background: var(--surface-muted);
  color: var(--coral);
}

.tools-log-summary {
  margin-top: 14px;
}

.tools-log-summary pre {
  min-height: 150px;
  margin: 0;
  padding: 18px;
  overflow: auto;
  color: var(--ink);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.tools-command[hidden] {
  display: none;
}

.tools-command {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: start center;
  padding: min(16vh, 140px) 18px 32px;
}

.tools-command-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(12, 9, 18, 0.58);
  backdrop-filter: blur(5px);
}

.tools-command-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 600px);
  max-height: min(68vh, 600px);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.3);
}

.tools-command-input {
  height: 58px;
  padding: 0 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.tools-command-input input {
  font-size: 15px;
}

.tools-command-results {
  max-height: calc(min(68vh, 600px) - 58px);
  padding: 8px;
  overflow-y: auto;
}

.tools-command-results button {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
}

.tools-command-results button:hover {
  background: var(--surface-hover);
}

.tools-command-results button > svg {
  width: 18px;
  color: var(--green);
}

.tools-command-results span {
  min-width: 0;
  display: grid;
}

.tools-command-results strong {
  font-size: 13px;
}

.tools-command-results small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tools-modal-open {
  overflow: hidden;
}

@media (max-width: 1100px) {
  .tools-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .tools-workspace {
    padding-inline: 30px;
  }

  .tools-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tools-stats > div:nth-child(3) {
    border-right: 0;
  }

  .tools-stats > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 860px) {
  .tools-shell {
    display: block;
    border-inline: 0;
  }

  .tools-sidebar {
    padding: 28px 18px 22px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tools-sidebar-heading {
    padding-bottom: 16px;
  }

  .tools-sidebar nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: thin;
  }

  .tools-nav-group {
    display: contents;
  }

  .tools-nav-group h2 {
    display: none;
  }

  .tools-nav-group button {
    width: auto;
    min-width: max-content;
    grid-template-columns: 18px max-content;
    border: 1px solid var(--line);
    background: var(--paper);
  }

  .tools-nav-group button .tools-nav-arrow {
    display: none;
  }

  .tools-workspace {
    padding: 40px 18px 64px;
  }
}

@media (max-width: 700px) {
  .tools-header {
    padding-inline: 14px;
  }

  .tools-workspace-header {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 13px;
    margin-bottom: 24px;
  }

  .tools-title-icon {
    width: 44px;
    height: 44px;
  }

  .tools-title-icon svg {
    width: 21px;
  }

  .tools-workspace-header h2 {
    font-size: 30px;
  }

  .tools-editor-grid,
  .tools-card-layout,
  .tools-control-grid,
  .tools-probe-results {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .tools-probe-form .button {
    width: 100%;
  }

  .tools-network-address {
    align-items: flex-start;
    padding: 20px;
  }

  .tools-pane textarea,
  .tools-single-editor .tools-pane textarea,
  .tools-card-layout .tools-pane textarea,
  .tools-wechat-preview article {
    min-height: 320px;
  }

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

  .tools-stats > div,
  .tools-stats > div:nth-child(3) {
    min-height: 78px;
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }

  .tools-stats > div:nth-child(2n) {
    border-right: 0;
  }

  .tools-stats > div:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .tools-stats strong {
    font-size: 24px;
  }

  .tools-segmented {
    max-width: 100%;
    overflow-x: auto;
  }

  .tools-segmented span {
    min-width: max-content;
    padding-inline: 10px;
  }

  .tools-canvas-wrap {
    padding: 14px;
  }
}

/* Astro-inspired visual system */
body {
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

::selection {
  background: var(--accent);
  color: #ffffff;
}

.site-header,
.admin-header {
  position: sticky;
  top: 0;
  border-bottom-color: var(--line);
  background: var(--header-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
}

.brand {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 17px;
  font-weight: 800;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border: 1px solid color-mix(in srgb, var(--accent) 65%, var(--line));
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 5px 5px 0 color-mix(in srgb, var(--accent-2) 78%, transparent);
}

.brand-mark svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
}

.site-nav,
.admin-nav {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.site-nav a,
.admin-nav a,
.link-button {
  position: relative;
}

.site-nav a::after,
.admin-nav a::after {
  position: absolute;
  right: 0;
  bottom: -7px;
  left: 0;
  height: 2px;
  background: var(--accent);
  content: "";
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 160ms ease, transform 160ms ease;
}

.site-nav a:hover,
.admin-nav a:hover,
.link-button:hover {
  color: var(--ink);
}

.site-nav a:hover::after,
.admin-nav a:hover::after {
  opacity: 1;
  transform: scaleX(1);
}

.theme-toggle {
  width: 40px;
  height: 40px;
  flex-basis: 40px;
  border-radius: 7px;
  background: var(--surface);
  box-shadow: 3px 3px 0 var(--line);
  transition: color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.theme-toggle:hover {
  background: var(--green-soft);
  color: var(--accent);
  box-shadow: 1px 1px 0 var(--line);
  transform: translate(2px, 2px);
}

.home-intro {
  position: relative;
  overflow: hidden;
  padding: 0;
  background: var(--surface);
}

.home-intro::before {
  position: absolute;
  top: 0;
  left: max(20px, calc((100% - var(--shell)) / 2));
  width: 80px;
  height: 4px;
  background: var(--accent);
  box-shadow: 88px 0 0 var(--accent-2), 176px 0 0 var(--accent-3);
  content: "";
}

.home-intro-inner {
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 56px;
  padding-block: 92px 30px;
}

.home-intro-content {
  max-width: 900px;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 800;
}

.eyebrow::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: currentColor;
  content: "";
}

.home-intro h1 {
  max-width: 900px;
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 88px;
  font-weight: 850;
  line-height: 0.94;
}

.home-intro-content > p:not(.eyebrow) {
  max-width: 680px;
  margin: 26px 0 0;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.6;
}

.home-intro-footer {
  min-height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.home-status,
.home-intro-footer a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.home-status svg,
.home-intro-footer a svg {
  width: 15px;
  height: 15px;
}

.home-status {
  color: var(--accent-3);
}

.home-intro-footer a {
  color: var(--ink);
}

.home-intro-footer a:hover {
  color: var(--accent);
}

.home-intro-content > *,
.home-intro-footer {
  animation: astro-rise 520ms ease both;
}

.home-intro-content > h1 {
  animation-delay: 70ms;
}

.home-intro-content > p:last-child {
  animation-delay: 130ms;
}

.home-intro-footer {
  animation-delay: 190ms;
}

.article-section {
  padding-block: 88px 128px;
}

.section-heading {
  padding-bottom: 26px;
  border-bottom-color: var(--line);
}

.section-heading h2,
.admin-section-heading h2,
.empty-state h3,
.error-page h1 {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 800;
}

.section-heading h2 {
  font-size: 48px;
}

.section-heading > p,
.section-heading > span {
  font-size: 13px;
}

.category-tabs,
.filter-tabs {
  width: fit-content;
  max-width: 100%;
  gap: 3px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-muted);
}

.category-tabs {
  margin-top: 26px;
}

.category-tabs a,
.filter-tabs a {
  padding: 8px 13px;
  border: 0;
  border-radius: 5px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.category-tabs a.active,
.filter-tabs a.active {
  border: 0;
  background: var(--surface);
  color: var(--accent);
  box-shadow: 0 1px 4px rgba(25, 18, 40, 0.12);
}

.article-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 18px;
  margin-top: 26px;
}

.article-row {
  position: relative;
  min-height: 270px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  justify-content: space-between;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.article-row::before {
  position: absolute;
  top: 0;
  left: 30px;
  width: 52px;
  height: 3px;
  background: var(--accent);
  content: "";
}

.article-row:nth-child(3n + 2)::before {
  background: var(--accent-2);
}

.article-row:nth-child(3n)::before {
  background: var(--accent-3);
}

.article-row:hover {
  border-color: color-mix(in srgb, var(--accent) 50%, var(--line));
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.article-meta {
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px 16px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
  font-weight: 650;
}

.article-meta span:first-of-type {
  color: var(--accent);
}

.article-summary {
  display: flex;
  flex: 1;
  flex-direction: column;
}

.article-summary h3 {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 29px;
  font-weight: 780;
  line-height: 1.2;
}

.article-summary h3 a:hover {
  color: var(--accent);
}

.article-summary p {
  margin: 16px 0 24px;
}

.read-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: flex-start;
  margin-top: auto;
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.read-more svg {
  width: 15px;
  height: 15px;
  transition: transform 160ms ease;
}

.read-more:hover svg {
  transform: translate(3px, -3px);
}

.site-footer {
  position: relative;
  background: var(--surface);
}

.site-footer::before {
  position: absolute;
  top: -1px;
  left: 0;
  width: 34%;
  height: 2px;
  background: var(--accent);
  content: "";
}

.footer-inner {
  min-height: 96px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.post {
  position: relative;
  padding-top: 76px;
}

.post::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  content: "";
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.back-link svg {
  width: 15px;
  height: 15px;
}

.back-link:hover {
  color: var(--accent);
}

.post-header .eyebrow {
  margin-top: 54px;
}

.post-header h1 {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 64px;
  font-weight: 830;
  line-height: 1.05;
}

.post-meta {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.post-meta a {
  color: var(--accent);
}

.post-deck {
  border-left-color: var(--accent-2);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 20px;
}

.article-toc {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.article-toc details > summary {
  color: var(--accent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
  font-size: 11px;
}

.article-toc nav {
  border-left-color: color-mix(in srgb, var(--accent) 45%, var(--line));
}

.article-toc a:hover {
  background: var(--green-soft);
  color: var(--accent);
}

.prose {
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 18px;
  line-height: 1.9;
}

.prose h1,
.prose h2,
.prose h3,
.prose h4 {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 800;
}

.prose h2 {
  position: relative;
  padding-left: 18px;
}

.prose h2::before {
  position: absolute;
  top: 0.22em;
  bottom: 0.22em;
  left: 0;
  width: 4px;
  background: var(--accent);
  content: "";
}

.prose a {
  color: var(--accent);
  text-decoration-color: color-mix(in srgb, var(--accent) 55%, transparent);
}

.prose blockquote {
  border-left-color: var(--accent-2);
  background: color-mix(in srgb, var(--surface-muted) 68%, transparent);
}

.prose pre {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.comments-section {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.comment {
  padding: 24px 20px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
}

.comment + .comment {
  margin-top: 12px;
}

.comment-list {
  display: grid;
  gap: 0;
}

.comment-form h3 {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 800;
}

input,
textarea,
select {
  border-radius: 6px;
  background: var(--paper);
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}

.button {
  min-height: 44px;
  border-radius: 6px;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.button.primary {
  background: var(--button-bg);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--accent-2) 72%, transparent);
}

.button.primary:hover {
  background: var(--green-dark);
  box-shadow: 2px 2px 0 color-mix(in srgb, var(--accent-2) 72%, transparent);
  transform: translate(2px, 2px);
}

.button.secondary:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.notice {
  border-left: 4px solid var(--accent);
  border-radius: 6px;
}

.admin-main {
  padding-top: 60px;
}

.admin-titlebar h1,
.editor-toolbar h1,
.auth-panel h1 {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 820;
}

.stats {
  gap: 12px;
  border: 0;
}

.stats > div,
.stats > a {
  min-height: 124px;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

.stats > :last-child {
  border-right: 1px solid var(--line);
}

.stats strong {
  color: var(--accent);
  font-family: Inter, ui-sans-serif, sans-serif;
  font-size: 38px;
  font-weight: 800;
}

.stats span,
.table-sub,
th {
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.table-wrap {
  overflow: hidden auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface);
}

thead {
  background: var(--surface-muted);
}

tbody tr:hover {
  background: var(--green-soft);
}

.status {
  border: 1px solid var(--line);
  font-family: ui-monospace, "SFMono-Regular", Menlo, Monaco, Consolas, monospace;
}

.status-published {
  border-color: color-mix(in srgb, var(--accent-3) 45%, var(--line));
  background: color-mix(in srgb, var(--accent-3) 12%, var(--surface));
  color: var(--accent-3);
}

.status-draft {
  background: var(--surface-muted);
}

.icon-button {
  border: 1px solid transparent;
  border-radius: 5px;
}

.icon-button:hover {
  border-color: var(--line);
  background: var(--surface);
  color: var(--accent);
}

.tiptap-shell {
  border-radius: 7px;
  box-shadow: var(--shadow);
}

.tiptap-toolbar {
  background: var(--surface-muted);
}

.tiptap-toolbar button:hover,
.tiptap-toolbar button.is-active {
  color: var(--accent);
}

.title-field input {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 780;
}

.settings-section h2,
.category-create h2 {
  font-family: Inter, ui-sans-serif, sans-serif;
  font-weight: 800;
}

.auth-panel {
  position: relative;
  background: var(--paper);
}

.auth-panel::after {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 42%;
  height: 4px;
  background: var(--accent);
  box-shadow: 90px 0 0 var(--accent-2), 180px 0 0 var(--accent-3);
  content: "";
}

.auth-visual img {
  filter: grayscale(0.75) contrast(1.08);
}

.moderation-item,
.category-admin-list article {
  padding-inline: 16px;
  transition: background-color 160ms ease;
}

.moderation-item:hover,
.category-admin-list article:hover {
  background: var(--surface-hover);
}

@keyframes astro-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .home-intro h1 {
    font-size: 72px;
  }

  .post-header h1 {
    font-size: 54px;
  }

  .article-toc {
    margin-bottom: 36px;
  }
}

@media (max-width: 760px) {
  .site-header .header-inner {
    gap: 14px;
  }

  .site-header .brand > span:last-child {
    max-width: min(32vw, 130px);
  }

  .home-intro::before {
    left: 14px;
    width: 56px;
    box-shadow: 64px 0 0 var(--accent-2), 128px 0 0 var(--accent-3);
  }

  .home-intro-inner {
    min-height: 390px;
    gap: 42px;
    padding-block: 64px 26px;
  }

  .home-intro h1 {
    font-size: 52px;
  }

  .home-intro-content > p:not(.eyebrow) {
    margin-top: 20px;
    font-size: 17px;
  }

  .home-intro-footer {
    align-items: flex-start;
  }

  .home-status {
    max-width: 55%;
  }

  .article-section {
    padding-block: 64px 84px;
  }

  .section-heading h2 {
    font-size: 36px;
  }

  .article-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-row {
    min-height: 0;
    padding: 26px 24px;
  }

  .article-row::before {
    left: 24px;
  }

  .article-summary h3 {
    font-size: 26px;
  }

  .post {
    padding-top: 48px;
  }

  .post-header .eyebrow {
    margin-top: 42px;
  }

  .post-header h1 {
    font-size: 42px;
  }

  .article-toc {
    padding: 16px;
  }

}

@media (max-width: 960px) {
  .mobile-toc-trigger {
    position: fixed;
    right: 16px;
    bottom: calc(18px + env(safe-area-inset-bottom));
    z-index: 18;
    min-width: 58px;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 13px;
    border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--line));
    border-radius: 7px;
    background: var(--button-bg);
    box-shadow: 0 10px 28px rgba(20, 14, 32, 0.24);
    color: var(--button-fg);
    cursor: pointer;
    font-size: 12px;
    font-weight: 750;
  }

  .mobile-toc-trigger svg {
    width: 18px;
    height: 18px;
  }

  .mobile-toc-dialog {
    width: 100%;
    max-width: none;
    max-height: min(72vh, 620px);
    display: none;
    margin: auto 0 0;
    padding: 0 14px calc(18px + env(safe-area-inset-bottom));
    overflow: hidden;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 7px 7px 0 0;
    background: var(--surface);
    color: var(--ink);
  }

  .mobile-toc-dialog[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .mobile-toc-dialog::backdrop {
    background: rgba(12, 9, 18, 0.55);
    backdrop-filter: blur(3px);
  }

  .mobile-toc-header {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
  }

  .mobile-toc-header strong {
    font-size: 14px;
  }

  .mobile-toc-header button {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
  }

  .mobile-toc-header button svg {
    width: 20px;
    height: 20px;
  }

  .mobile-toc-dialog nav {
    display: grid;
    gap: 2px;
    padding: 10px 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .mobile-toc-dialog nav a {
    min-height: 42px;
    display: flex;
    align-items: center;
    padding: 8px 10px;
    border-radius: 4px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
  }

  .mobile-toc-dialog nav a:active {
    background: var(--green-soft);
    color: var(--accent);
  }

  .mobile-toc-dialog .toc-level-2 {
    padding-left: 22px;
  }

  .mobile-toc-dialog .toc-level-3 {
    padding-left: 34px;
  }

  .mobile-toc-dialog .toc-level-4 {
    padding-left: 46px;
  }

}

@media (max-width: 760px) {
  .prose {
    font-size: 17px;
  }

  .prose h2 {
    padding-left: 14px;
  }

  .stats {
    gap: 7px;
  }

  .stats > div,
  .stats > a {
    min-height: 104px;
    padding-inline: 10px;
  }

  .stats strong {
    font-size: 31px;
  }

  .admin-main {
    padding-top: 42px;
  }

  .table-wrap {
    overflow-x: auto;
  }
}

@media (max-width: 380px) {
  .home-intro h1 {
    font-size: 44px;
  }

  .home-intro-footer {
    flex-direction: column;
    gap: 12px;
  }

  .home-status {
    max-width: none;
  }

  .post-header h1 {
    font-size: 37px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-intro-content > *,
  .home-intro-footer {
    animation: none;
  }

  .article-row,
  .read-more svg,
  .button,
  .theme-toggle {
    transition: none;
  }
}
