* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-main: #0f172a;
  --bg-card: #1a3b5a;
  --bg-code: #193856;
  --border-color: #2a4b6c;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --accent-color: #38bdf8;
  --accent-hover: #7dd3fc;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.7;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
}

/* Page headers & Titles */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 1.5rem;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-color);
  position: relative;
}

.brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
}

.nav-menu a {
  color: var(--text-muted);
  text-decoration: none;
  margin-left: 1.25rem;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-menu a:hover {
  color: var(--accent-color);
}

.page-title {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.article-title {
  font-size: 2rem;
  color: #e6f1ff;
  margin-bottom: 0.5rem;
}

.accent-text {
  color: var(--accent-color);
}

.mb-1-5 {
  margin-bottom: 1.5rem;
}

/* Post cards */
.post-container {
  background-color: #112240;
  border: 1px solid #233554;
  border-radius: 10px;
  padding: 2.5rem;
  margin-top: 1.5rem;
  box-shadow: 0 10px 30px -15px rgba(2, 12, 27, 0.7);
}

.post-lists {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.post-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 1.5rem;
  transition: transform 0.15s ease;
  border-color: 0.15s ease;
  margin-bottom: 1.5rem;
}

.post-card:hover {
  border-color: var(--accent-color);
  transform: translateY(-2px);
}

.post-title {
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.post-title a {
  color: var(--text-main);
  text-decoration: none;
}

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

.post-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.post-summary {
  color: var(--text-main);
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

/* Tags */
.tags {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.tag-badge {
  background-color: var(--bg-main);
  color: var(--accent-color);
  border: 1px solid var(--border-color);
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-decoration: none;
  font-family: var(--font-mono);
}

.tag-badge:hover {
  border-color: var(--accent-color);
}

/* Article Body */
.article-body {
  margin-top: 1.5rem;
}

.article-body p,
.article-body li {
  text-align: justify;
  line-height: 1.8;
  color: #8892b0;
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
  overflow-wrap: break-word;
  word-break: break-word;
}

.article-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 8px;
  border: 1px solid #233554;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.article-body h1,
.article-body h2,
.article-body h3 {
  color: #fff;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

.article-body p {
  margin-bottom: 1.25rem;
}

.article-body ul,
.article-body ol {
  margin-left: 1.5rem;
  margin-bottom: 1.25rem;
}

.giscus-wraper {
  margin-top: 3rem; 
  min-height: 150px;
}

/* Code Blocks */
pre {
  background-color: var(--bg-code);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1rem;
  overflow-x: auto;
  margin: 1.25rem 0;
  font-family: var(--font-mono);
  font-size: 0.9rem;
}

code {
  font-family: var(--font-mono);
  background-color: var(--bg-code);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.875em;
}

pre code {
  padding: 0;
  background: transparent;
}

/* Archive Page */

.archive-item {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 0;
}

.archive-link {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
}

.archive-meta {
  margin: 0;
}

/* Page 404 Error */
.error-container {
  text-align: center;
  padding: 4rem 0;
}

.error-code {
  font-size: 3rem;
  color: var(--accent-color);
  font-family: var(--font-mono);
}

.error-message {
  font-size: 1.25rem;
  margin-top: 0.5rem;
  margin-bottom: 1.5rem;
}

.btn-primary {
  font-size: 1rem;
  padding: 0.5rem 1rem;
}

/* Search Input */
.search-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  color: var(--text-main);
  font-size: 1rem;
  margin-bottom: 1.5rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--accent-color);
}

/* Footer */
footer {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 100;
}

.menu-toggle span {
  width: 100%;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 3px;
  transition: all 0.3s ease-in-out;
}

.menu-toggle.is-active span:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
}

/* Mobile style */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .nav-menu {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
    z-index: 99;
  }

  .nav-menu.nav-active {
    display: flex;
  }

  .nav-menu a {
    margin-left: 0;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
  }

  .nav-menu a:last-child {
    border-bottom: none;
  }
}