:root {
  --retop-brand: #0d6efd;
  --retop-accent: #198754;
  --retop-card-shadow: rgba(0, 0, 0, 0.08);
  --retop-term-bg: #12151a;
  --retop-term-border: rgba(90, 247, 142, 0.22);
  --retop-term-prompt: #5af78e;
  --retop-term-name: #f8f9fa;
  --retop-term-cursor: #5af78e;
}

[data-bs-theme="dark"] {
  --retop-card-shadow: rgba(0, 0, 0, 0.35);
  --retop-term-bg: #0a0c0f;
  --retop-term-border: rgba(90, 247, 142, 0.18);
}

#themeToggle {
  line-height: 1;
}
#themeToggle .bi {
  font-size: 1.1rem;
}

.navbar-terminal {
  background: linear-gradient(180deg, #1a1f26 0%, var(--retop-term-bg) 100%) !important;
  border-bottom: 1px solid var(--retop-term-border);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.brand-cmd {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
  text-decoration: none;
  letter-spacing: 0;
}
.brand-cmd:hover .brand-cmd-name {
  color: #fff;
  text-shadow: 0 0 12px rgba(90, 247, 142, 0.35);
}
.brand-cmd-chrome {
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem 0.2rem 0;
  margin-right: 0.15rem;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}
.brand-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  opacity: 0.85;
}
.brand-dot-red { background: #ff5f57; }
.brand-dot-yellow { background: #febc2e; }
.brand-dot-green { background: #28c840; }

.brand-cmd-line {
  display: inline-flex;
  align-items: baseline;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.brand-cmd-prompt {
  color: var(--retop-term-prompt);
  margin-right: 0.35rem;
  font-weight: 500;
  opacity: 0.92;
}
.brand-cmd-name {
  color: var(--retop-term-name);
  transition: color 0.15s ease, text-shadow 0.15s ease;
}

@media (max-width: 575.98px) {
  .brand-cmd-line {
    font-size: 0.95rem;
  }
}

.navbar-brand {
  letter-spacing: -0.03em;
}

.page-header {
  border-bottom: 1px solid var(--bs-border-color);
  padding-bottom: 1rem;
  margin-bottom: 1rem;
}

.feed-tabs .nav-link {
  font-weight: 500;
}
.feed-tabs .nav-link:not(.active) {
  color: var(--bs-secondary-color);
}

.feed-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.feed-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem var(--retop-card-shadow) !important;
}
.feed-card .card-title a:hover {
  color: var(--retop-accent) !important;
}

.prose {
  font-size: 1.125rem;
  line-height: 1.75;
  word-wrap: break-word;
}
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 {
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
  font-weight: 600;
}
.prose p { margin-bottom: 1rem; }
.prose ul, .prose ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}
.prose pre {
  overflow-x: auto;
  background: var(--bs-dark);
  color: var(--bs-light);
  padding: 1rem 1.25rem;
  border-radius: var(--bs-border-radius-lg);
  font-size: 0.875rem;
}
.prose code {
  font-size: 0.875em;
  background: var(--bs-secondary-bg);
  padding: 0.15em 0.4em;
  border-radius: var(--bs-border-radius-sm);
  color: var(--bs-emphasis-color);
}
.prose pre code {
  background: none;
  padding: 0;
  color: inherit;
}
.prose blockquote {
  margin: 0 0 1rem;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 0.25rem solid var(--retop-accent);
  color: var(--bs-secondary-color);
}
.prose img {
  max-width: 100%;
  height: auto;
  border-radius: var(--bs-border-radius);
}
.prose table {
  width: 100%;
  margin-bottom: 1rem;
}
.prose th, .prose td {
  border: 1px solid var(--bs-border-color);
  padding: 0.5rem 0.75rem;
}
.prose a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.comment-body { white-space: pre-wrap; }

.profile-avatar {
  width: 4rem;
  height: 4rem;
  font-size: 1.5rem;
  font-weight: 600;
  flex-shrink: 0;
}
.profile-avatar-lg {
  width: 5.5rem;
  height: 5.5rem;
  font-size: 2rem;
}
.profile-avatar-sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.75rem;
}
.profile-avatar-xs {
  width: 2rem !important;
  height: 2rem !important;
  font-size: 0.75rem !important;
}
.bg-secondary.profile-avatar {
  background-color: var(--bs-secondary) !important;
}
.profile-avatar-img {
  object-fit: cover;
  display: inline-block;
  vertical-align: middle;
}
.navbar .profile-avatar-sm {
  width: 1.75rem;
  height: 1.75rem;
}

.auth-card {
  max-width: 28rem;
}

.article-meta .bi {
  opacity: 0.7;
}

.feed-layout {
  align-items: start;
}

.feed-sidebar-sticky {
  position: sticky;
  top: 5rem;
}

.feed-banner-body {
  background: linear-gradient(145deg, #198754 0%, #0d6efd 100%);
}

.feed-banner-icon .bi {
  font-size: 1.75rem;
  opacity: 0.9;
}

.feed-banner-text {
  opacity: 0.92;
  line-height: 1.45;
}

.tag-sidebar-link {
  color: var(--bs-body-color);
  border-radius: var(--bs-border-radius);
  padding: 0.15rem 0.25rem;
  margin: -0.15rem -0.25rem;
}
.tag-sidebar-link:hover {
  color: var(--retop-accent);
  background: var(--bs-secondary-bg);
}
.tag-sidebar-link.active {
  color: var(--retop-accent);
  font-weight: 600;
}
.tag-sidebar-link .badge {
  font-size: 0.7rem;
}
