:root {
  --site-accent: #0d6efd;
}

body {
  background: #f8f9fb;
}

.site-intro-card {
  background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
}

.post-card {
  transition: transform .15s ease, box-shadow .15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
}

.post-content {
  line-height: 1.9;
  font-size: 1.05rem;
  word-break: break-word;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin: 1.6rem 0 .8rem;
  font-weight: 700;
}

.post-content p,
.post-content ul,
.post-content ol,
.post-content blockquote,
.post-content pre,
.post-content table {
  margin-bottom: 1rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: .75rem;
}

.post-content pre {
  padding: 1rem;
  border-radius: .75rem;
  overflow: auto;
  background: #f6f8fa;
  border: 1px solid #e9ecef;
}

.post-content code {
  background: rgba(13, 110, 253, .08);
  padding: .12rem .35rem;
  border-radius: .35rem;
  font-size: .95em;
}

.post-content pre code {
  background: transparent;
  padding: 0;
}

.post-content blockquote {
  border-left: 4px solid #d0d7de;
  padding-left: 1rem;
  color: #6c757d;
}

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

.post-content table th,
.post-content table td {
  border: 1px solid #dee2e6;
  padding: .65rem .75rem;
}

.post-content table th {
  background: #f8f9fa;
}

.admin-bg {
  background: #eef2f7;
}


.site-search-form,
.admin-post-search-form {
  min-width: 0;
}

.site-search-input,
.admin-post-search-input {
  min-width: 0;
}

.site-search-submit,
.admin-post-search-submit,
.admin-post-create-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  writing-mode: horizontal-tb;
  text-orientation: mixed;
  word-break: keep-all;
  line-height: 1.2;
  flex: 0 0 auto;
}

.site-search-submit {
  min-width: 4.5rem;
  margin-left: .5rem;
}

.admin-post-search-submit,
.admin-post-create-btn {
  min-width: 5.5rem;
}


.table td,
.table th {
  white-space: nowrap;
}

.table td:nth-child(2),
.table th:nth-child(2) {
  white-space: normal;
}

.asset-thumb {
  width: 136px;
  height: 96px;
  object-fit: cover;
}

.asset-file-box {
  width: 136px;
  height: 96px;
  font-weight: 700;
}

.min-w-0 {
  min-width: 0;
}


.post-toc {
  border-radius: 1rem;
}

.toc-list li + li {
  margin-top: .45rem;
}

.toc-level-2 { padding-left: .75rem; }
.toc-level-3 { padding-left: 1.5rem; }
.toc-level-4 { padding-left: 2.25rem; }
.toc-level-5 { padding-left: 3rem; }
.toc-level-6 { padding-left: 3.75rem; }

.toc-link {
  color: #495057;
}

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

.post-content .anchor-link {
  opacity: 0;
  margin-left: .4rem;
  color: #98a2b3;
  text-decoration: none;
  font-size: .9em;
  transition: opacity .15s ease, color .15s ease;
}

.post-content .heading-anchor:hover .anchor-link,
.post-content .heading-anchor:focus-within .anchor-link {
  opacity: 1;
}

.post-content .anchor-link:hover {
  color: var(--site-accent);
}

.post-content .codehilite {
  margin-bottom: 1rem;
  background: #fbfcfe;
  border: 1px solid #d8e0ea;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04);
}

.post-content .code-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: .65rem .85rem;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3f8 100%);
  border-bottom: 1px solid #d8e0ea;
}

.post-content .code-language {
  display: inline-flex;
  align-items: center;
  min-height: 1.85rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid #d0d7de;
  color: #344054;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.post-content .code-copy-btn {
  appearance: none;
  border: 1px solid #cbd5e1;
  background: #ffffff;
  color: #334155;
  border-radius: .65rem;
  padding: .35rem .7rem;
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.2;
  transition: all .15s ease;
}

.post-content .code-copy-btn:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

.post-content .code-copy-btn.copied {
  background: #e8fff2;
  border-color: #86efac;
  color: #166534;
}

.post-content .codehilite pre {
  margin: 0;
  padding: 1rem 1.15rem 1.1rem;
  background: #fbfcfe;
  border: 0;
  color: #1f2937;
  line-height: 1.7;
  overflow-x: auto;
}

.post-content .codehilite code {
  display: block;
  background: transparent;
  color: inherit;
  padding: 0;
  font-size: .92rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  white-space: pre;
}

.search-snippet mark,
.post-content mark {
  background: #fff3bf;
  padding: 0 .18rem;
  border-radius: .25rem;
}

.toc-link.is-active {
  color: var(--site-accent);
  font-weight: 700;
}

.neighbor-card,
.related-card {
  display: block;
  padding: 1rem 1.1rem;
  border: 1px solid #e5e7eb;
  border-radius: 1rem;
  background: #fff;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}

.neighbor-card:hover,
.related-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 28px rgba(15, 23, 42, .08);
  border-color: #cbd5e1;
}

.neighbor-card.is-empty {
  color: #98a2b3;
  background: #f8fafc;
}

.neighbor-label {
  font-size: .8rem;
  color: #6b7280;
  margin-bottom: .35rem;
}

.neighbor-title {
  font-weight: 600;
  color: #111827;
}

.archive-sidebar-card {
  position: sticky;
  top: 5.75rem;
}

.back-to-top-btn {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 1030;
  border: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: rgba(13, 110, 253, .95);
  color: #fff;
  font-size: 1.1rem;
  box-shadow: 0 12px 24px rgba(13, 110, 253, .25);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: all .18s ease;
}

.back-to-top-btn.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

@media (max-width: 991.98px) {
  .site-search-form {
    margin-top: .75rem;
    width: 100%;
  }

  .site-search-input {
    flex: 1 1 auto;
  }

  .archive-sidebar-card {
    position: static;
  }
}

@media (max-width: 767.98px) {
  body {
    background: #f7f8fb;
  }

  .admin-post-search-form {
    width: 100%;
  }

  .admin-post-search-input {
    flex: 1 1 auto;
  }

  .admin-post-search-submit,
  .admin-post-create-btn {
    min-width: 5rem;
  }

  .post-detail-card .card-body,
  .card .card-body {
    padding: 1rem;
  }

  .post-content {
    font-size: 1rem;
    line-height: 1.8;
  }

  .post-content h1,
  .post-content h2 {
    font-size: 1.45rem;
    line-height: 1.35;
  }

  .post-content h3 {
    font-size: 1.2rem;
  }

  .post-content pre,
  .post-content .codehilite pre {
    padding: .85rem .95rem;
    border-radius: .9rem;
    font-size: .88rem;
    -webkit-overflow-scrolling: touch;
  }

  .post-content .code-toolbar {
    padding: .55rem .7rem;
  }

  .tag-cloud .badge {
    font-size: .78rem;
  }

  .toc-level-2,
  .toc-level-3,
  .toc-level-4,
  .toc-level-5,
  .toc-level-6 {
    padding-left: .75rem;
  }

  .back-to-top-btn {
    right: .75rem;
    bottom: .75rem;
  }
}


.post-content img,
.post-content .post-zoomable-image {
  cursor: zoom-in;
  transition: transform .18s ease, box-shadow .18s ease;
  box-shadow: 0 8px 24px rgba(15, 23, 42, .08);
}

.post-content img:hover,
.post-content .post-zoomable-image:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, .12);
}

.viewer-backdrop {
  background: rgba(15, 23, 42, .92) !important;
}

.viewer-toolbar > ul {
  background: rgba(15, 23, 42, .68);
  border-radius: 999px;
  padding: .15rem .35rem;
}

.viewer-button,
.viewer-toolbar > ul > li {
  transition: transform .15s ease, opacity .15s ease;
}

.viewer-toolbar > ul > li:hover,
.viewer-button:hover {
  transform: scale(1.06);
}


/* Search and action bar refinements */
.site-search-form {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.site-search-input {
  width: clamp(14rem, 28vw, 22rem);
  height: 3rem;
  padding: 0 1rem;
  border-radius: .9rem;
  border-color: rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 1px 2px rgba(15, 23, 42, .08);
}

.site-search-input:focus {
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .18);
}

.site-search-submit {
  min-width: 5.5rem;
  height: 3rem;
  padding: 0 1rem;
  margin-left: 0;
  border-radius: .9rem;
  font-weight: 700;
  letter-spacing: .02em;
}

.admin-post-toolbar {
  gap: 1rem;
}

.admin-post-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .875rem;
}

.admin-post-search-form {
  display: flex;
  align-items: center;
  gap: .875rem;
}

.admin-post-search-input {
  width: clamp(18rem, 34vw, 28rem);
  height: 3.25rem;
  padding: 0 1.15rem;
  border-radius: 1rem;
  border-color: #cfd8e3;
  background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
}

.admin-post-search-input:focus {
  box-shadow: 0 0 0 .2rem rgba(13, 110, 253, .16);
}

.admin-post-search-submit,
.admin-post-create-btn {
  min-width: 6.25rem;
  height: 3.25rem;
  padding: 0 1.15rem;
  border-radius: 1rem;
  font-weight: 700;
  letter-spacing: .01em;
}

.admin-nav-action {
  min-width: 5.5rem;
  height: 2.75rem;
  padding: 0 1rem;
  border-radius: .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  white-space: nowrap;
}

@media (max-width: 991.98px) {
  .site-search-form,
  .admin-post-search-form,
  .admin-post-actions {
    width: 100%;
  }

  .site-search-input,
  .admin-post-search-input {
    width: 100%;
  }
}

@media (max-width: 575.98px) {
  .site-search-form,
  .admin-post-search-form {
    gap: .625rem;
  }

  .site-search-input,
  .site-search-submit,
  .admin-post-search-input,
  .admin-post-search-submit,
  .admin-post-create-btn {
    height: 2.9rem;
    border-radius: .85rem;
  }

  .site-search-submit,
  .admin-post-search-submit,
  .admin-post-create-btn {
    min-width: 5rem;
    padding: 0 .9rem;
  }
}


.asset-upload-label {
  margin-bottom: .75rem;
}

.asset-upload-row {
  --bs-gutter-y: 0;
}

.asset-upload-input,
.asset-upload-submit {
  min-height: 3.5rem;
  border-radius: 1rem;
}

.asset-upload-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.asset-upload-help {
  margin-top: .75rem;
}

@media (max-width: 991.98px) {
  .asset-upload-submit {
    min-height: 3.25rem;
  }
}


.reminder-surface {
  background: #ffffff;
  border: 1px solid #e9ecef;
  border-radius: 1rem;
}

.reminder-surface-success {
  background: #ecfdf3;
  border-color: #a7f3d0;
}

.reminder-surface-warning {
  background: #fff8e1;
  border-color: #fde68a;
}

.reminder-surface-purple {
  background: #f5efff;
  border-color: #d8b4fe;
}

.reminder-surface-danger {
  background: #fff1f2;
  border-color: #fda4af;
}

.badge-reminder-purple {
  background: #7c3aed;
  color: #fff;
}

.text-reminder-purple {
  color: #7c3aed !important;
}

.reminder-legend {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}

.reminder-legend .badge {
  font-size: .85rem;
  padding: .45rem .7rem;
}
