.blog-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 14% 26%, rgba(22, 118, 80, 0.18), transparent 36%),
    radial-gradient(circle at 84% 8%, rgba(255, 154, 84, 0.2), transparent 32%),
    rgba(255, 255, 255, 0.88);
}

.blog-hero::after {
  content: "";
  position: absolute;
  inset: auto -80px -80px auto;
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(48, 152, 103, 0.24), rgba(48, 152, 103, 0));
  pointer-events: none;
}

.blog-auth-state {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: #2d4d73;
}

.blog-admin-entry {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(31, 113, 221, 0.35);
  border-radius: 10px;
  padding: 7px 12px;
  background: rgba(31, 113, 221, 0.1);
  color: #1d4f90;
  font-weight: 700;
  font-size: 0.92rem;
  line-height: 1.2;
  font-family: inherit;
  text-decoration: none;
  width: fit-content;
  white-space: nowrap;
}

.blog-admin-entry:hover {
  border-color: rgba(31, 113, 221, 0.58);
  background: rgba(31, 113, 221, 0.16);
}

.blog-admin-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.blog-admin-toggle {
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
}

.blog-admin-status {
  margin: 8px 0 0;
  color: #31567f;
  font-size: 0.88rem;
}

.blog-admin-status.error {
  color: #8e2f2f;
}

.blog-layout {
  margin-top: 16px;
  display: grid;
  gap: 12px;
  grid-template-columns: 320px minmax(0, 1fr);
  align-items: start;
}

.blog-sidebar {
  padding: 14px;
  display: grid;
  gap: 12px;
  position: sticky;
  top: 14px;
}

.sidebar-head h2 {
  margin: 0;
}

.sidebar-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.post-btn {
  width: 100%;
  border: 1px solid rgba(24, 36, 63, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.84);
  padding: 10px;
  text-align: left;
  display: grid;
  gap: 6px;
  cursor: pointer;
}

.post-btn:hover {
  border-color: rgba(31, 113, 221, 0.42);
  transform: translateY(-1px);
}

.post-btn.active {
  border-color: rgba(31, 113, 221, 0.62);
  box-shadow: 0 8px 20px rgba(31, 113, 221, 0.12);
}

.post-btn time {
  color: #1b4f93;
  font-size: 0.78rem;
  font-weight: 700;
}

.post-btn strong {
  font-size: 0.96rem;
}

.post-btn p {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.post-status {
  width: fit-content;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.post-status.hidden {
  border: 1px solid rgba(197, 53, 53, 0.28);
  color: #8d2e2e;
  background: rgba(227, 90, 90, 0.12);
}

.maintain-box {
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
}

.maintain-box h3 {
  margin: 0 0 8px;
  font-size: 0.96rem;
}

.maintain-box code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 0.78rem;
  color: #2d4771;
}

.blog-detail {
  overflow: hidden;
  padding: 0;
}

.post-shell {
  display: grid;
}

.post-cover {
  margin: 0;
  border-bottom: 1px solid rgba(24, 36, 63, 0.11);
  background: rgba(255, 255, 255, 0.8);
}

.post-cover img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  object-position: center;
}

.post-body {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.editor-shell .post-body {
  gap: 14px;
}

.editor-toolbar {
  border-bottom: 1px solid rgba(24, 36, 63, 0.12);
  background: rgba(255, 255, 255, 0.82);
  padding: 12px 16px;
  display: grid;
  gap: 10px;
}

.editor-toolbar p {
  margin: 0;
}

.editor-title {
  color: #1f4e8d;
  font-size: 0.9rem;
  font-weight: 700;
}

.editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.editor-actions .btn {
  margin: 0;
}

.editor-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  gap: 12px;
  align-items: start;
}

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

.editor-preview-column {
  position: sticky;
  top: 12px;
}

.editor-preview-panel {
  padding: 10px;
}

.editor-preview-panel h3 {
  margin: 0;
}

.editor-preview-panel p {
  margin: 4px 0 0;
  color: #546883;
  font-size: 0.82rem;
}

.editor-preview-shell {
  margin-top: 10px;
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.86);
}

.editor-preview-shell .post-body {
  padding: 12px;
}

.editor-preview-empty {
  margin: 0;
  padding: 16px 12px;
  color: #5f6f86;
}

.btn-danger {
  border-color: rgba(197, 53, 53, 0.34);
  color: #8d2f2f;
  background: rgba(229, 82, 82, 0.1);
}

.btn-danger:hover {
  border-color: rgba(197, 53, 53, 0.6);
}

.editor-hint {
  color: #486284;
  font-size: 0.84rem;
}

.editor-hint.error {
  color: #8d2f2f;
}

.editor-fieldset {
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.82);
  padding: 12px;
  display: grid;
  gap: 10px;
}

.editor-fieldset h3 {
  margin: 0;
  color: #244d7a;
  font-size: 0.94rem;
}

.editor-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.editor-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.editor-field.full {
  grid-column: 1 / -1;
}

.editor-field span {
  color: #2d4f78;
  font-size: 0.84rem;
  font-weight: 600;
}

.editor-field input,
.editor-field textarea,
.editor-field select {
  display: block;
  width: 100%;
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: rgba(255, 255, 255, 0.92);
}

.editor-field textarea {
  resize: vertical;
}

.editor-field input:focus,
.editor-field textarea:focus,
.editor-field select:focus {
  border-color: rgba(31, 113, 221, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 113, 221, 0.12);
}

.editor-field input[readonly] {
  background: rgba(238, 244, 251, 0.88);
  color: #5a6f8b;
  border-style: dashed;
}

.editor-cover-preview {
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.75);
}

.editor-cover-preview img {
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  display: block;
}

.editor-upload-box {
  border: 1px dashed rgba(24, 36, 63, 0.24);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.76);
  padding: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.editor-upload-box input[type="file"] {
  max-width: 100%;
}

.editor-gallery-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.editor-gallery-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.editor-gallery-grid {
  margin-top: 0;
}

.editor-gallery-card {
  overflow: visible;
}

.editor-gallery-card figcaption {
  display: grid;
  gap: 8px;
}

.editor-gallery-card textarea,
.editor-gallery-card input {
  width: 100%;
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 8px;
  padding: 8px;
  font-size: 0.84rem;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.92);
}

.editor-gallery-card textarea {
  min-height: 64px;
  resize: vertical;
}

.editor-gallery-card .caption-label {
  color: #385677;
  font-size: 0.76rem;
  font-weight: 600;
}

.editor-version-list {
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  overflow: auto;
}

.editor-version-list table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.editor-version-list th,
.editor-version-list td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(24, 36, 63, 0.1);
  vertical-align: top;
  text-align: left;
  color: #2b4466;
}

.editor-version-list th {
  font-weight: 700;
  color: #214874;
  background: rgba(236, 244, 255, 0.75);
}

.editor-version-list tbody tr:last-child td {
  border-bottom: none;
}

.editor-version-list code {
  font-size: 0.76rem;
}

.editor-version-list .btn {
  white-space: nowrap;
}

.error-text {
  color: #8d2f2f;
}

.post-kicker {
  margin: 0;
  color: #245786;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.77rem;
  text-transform: uppercase;
}

.post-title {
  margin: 0;
  font-family: "ZCOOL KuaiLe", "Kaiti SC", cursive;
  font-size: clamp(1.55rem, 1.4vw + 1rem, 2.4rem);
  color: #16386b;
}

.post-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

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

.meta-chip {
  border-radius: 999px;
  border: 1px solid rgba(24, 36, 63, 0.15);
  background: rgba(255, 255, 255, 0.8);
  padding: 5px 10px;
  font-size: 0.8rem;
  color: #2f4769;
}

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

.tag-chip {
  border-radius: 999px;
  border: 1px solid rgba(44, 142, 98, 0.28);
  background: rgba(44, 142, 98, 0.13);
  color: #1c6648;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 4px 10px;
}

.post-text {
  display: grid;
  gap: 10px;
}

.post-text p {
  margin: 0;
  color: #2e3f58;
  line-height: 1.82;
}

.post-engagement {
  border-top: 1px solid rgba(24, 36, 63, 0.12);
  padding-top: 10px;
  display: grid;
  gap: 10px;
}

.engagement-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.engagement-head h3 {
  margin: 0;
  font-size: 1.06rem;
  color: #213f67;
}

.engagement-stats {
  margin: 0;
  color: #4a607f;
  font-size: 0.85rem;
}

.engagement-controls {
  display: flex;
  gap: 8px;
}

.btn-like.active {
  border-color: rgba(33, 117, 221, 0.44);
  color: #1a4f90;
  background: rgba(33, 117, 221, 0.1);
}

.comment-wrap {
  display: grid;
  gap: 8px;
}

.comment-wrap h4 {
  margin: 0;
  color: #274368;
}

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

.comment-card {
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.8);
  padding: 10px;
  display: grid;
  gap: 6px;
}

.comment-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.comment-head strong {
  color: #1f3f67;
  font-size: 0.88rem;
}

.comment-head time {
  color: #5a6e8f;
  font-size: 0.78rem;
}

.comment-content {
  margin: 0;
  line-height: 1.7;
  color: #2d3f59;
  white-space: pre-wrap;
  word-break: break-word;
}

.comment-form {
  display: grid;
  gap: 8px;
}

.comment-form textarea {
  width: 100%;
  min-height: 100px;
  border: 1px solid rgba(24, 36, 63, 0.2);
  border-radius: 10px;
  padding: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  resize: vertical;
  background: rgba(255, 255, 255, 0.92);
  outline: none;
}

.comment-form textarea:focus {
  border-color: rgba(31, 113, 221, 0.5);
  box-shadow: 0 0 0 3px rgba(31, 113, 221, 0.12);
}

.status-tip a {
  color: #1f65c8;
  text-decoration: none;
}

.status-tip a:hover {
  text-decoration: underline;
}

.post-gallery {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-card {
  border: 1px solid rgba(24, 36, 63, 0.12);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.8);
}

.gallery-card a {
  text-decoration: none;
  color: inherit;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  display: block;
}

.gallery-card figcaption {
  margin: 0;
  padding: 8px 10px;
  color: #4e5f78;
  font-size: 0.8rem;
}

.loading-tip,
.empty-tip,
.error-tip {
  margin: 0;
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .blog-layout {
    grid-template-columns: 1fr;
  }

  .blog-sidebar {
    position: static;
  }
}

@media (max-width: 700px) {
  .post-body {
    padding: 12px;
  }

  .editor-toolbar {
    padding: 10px 12px;
  }

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

  .editor-workspace {
    grid-template-columns: 1fr;
  }

  .editor-preview-column {
    position: static;
  }

  .post-gallery {
    grid-template-columns: 1fr;
  }
}
