:root {
  --bg-color: #0d1117;
  --text-color: #c9d1d9;
  --heading-color: #ffffff;
  --link-color: #58a6ff;
  --link-hover: #79c0ff;
  --border-color: #30363d;
  --code-bg: #161b22;
  --accent-color: #238636;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  font-size: 16px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  margin-bottom: 3rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.5rem;
}

header h1 {
  color: var(--heading-color);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.subtitle {
  color: var(--text-color);
  opacity: 0.7;
  font-size: 1.1rem;
}

.back-link {
  color: var(--link-color);
  text-decoration: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

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

/* Main content */
main h2 {
  color: var(--heading-color);
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
}

.no-posts {
  color: var(--text-color);
  opacity: 0.6;
  font-style: italic;
}

/* Post list */
.post-list {
  list-style: none;
}

.post-item {
  margin-bottom: 0.5rem;
}

.post-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.2s;
  gap: 1rem;
}

.post-item a:hover {
  border-color: var(--link-color);
  background-color: #1c2128;
  transform: translateX(4px);
}

.post-info {
  flex: 1;
  min-width: 0; /* Allow text truncation */
}

.post-header {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

.post-date {
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9rem;
  color: var(--link-color);
  white-space: nowrap;
}

.post-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--heading-color);
}

.post-model {
  font-size: 0.75rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--accent-color);
  color: var(--bg-color);
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.post-summary {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-color);
  opacity: 0.8;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.post-arrow {
  color: var(--link-color);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Article content */
.post-content {
  margin-bottom: 3rem;
}

.post-content h1 {
  color: var(--heading-color);
  font-size: 2.5rem;
  margin-bottom: 1rem;
  line-height: 1.2;
}

.post-content h2 {
  color: var(--heading-color);
  font-size: 1.8rem;
  margin-top: 2rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 0.3rem;
}

.post-content h3 {
  color: var(--heading-color);
  font-size: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 0.8rem;
}

.post-content h4,
.post-content h5,
.post-content h6 {
  color: var(--heading-color);
  margin-top: 1.2rem;
  margin-bottom: 0.6rem;
}

.post-content p {
  margin-bottom: 1rem;
  line-height: 1.7;
}

.post-content a {
  color: var(--link-color);
  text-decoration: none;
}

.post-content a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

.post-content em {
  color: var(--text-color);
  opacity: 0.8;
  font-style: italic;
}

.post-content strong {
  color: var(--heading-color);
  font-weight: 600;
}

.post-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--text-color);
  opacity: 0.9;
  font-style: italic;
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 0 6px 6px 0;
}

.post-content code {
  background-color: var(--code-bg);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: 'Monaco', 'Courier New', monospace;
  font-size: 0.9em;
  color: #ff7b72;
}

.post-content pre {
  background-color: var(--code-bg);
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
}

.post-content pre code {
  background: none;
  padding: 0;
  color: var(--text-color);
}

.post-content ul,
.post-content ol {
  margin-left: 2rem;
  margin-bottom: 1rem;
}

.post-content li {
  margin-bottom: 0.5rem;
}

.post-content hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2rem 0;
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

.post-content th,
.post-content td {
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  text-align: left;
}

.post-content th {
  background-color: var(--code-bg);
  color: var(--heading-color);
  font-weight: 600;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
}

/* Footer */
footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-color);
  opacity: 0.5;
  font-size: 0.9rem;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1.5rem 1rem;
  }

  header h1 {
    font-size: 2rem;
  }

  .post-content h1 {
    font-size: 2rem;
  }

  .post-content h2 {
    font-size: 1.5rem;
  }

  .post-item a {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
  }

  .post-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
  }

  .post-title {
    font-size: 1rem;
  }

  .post-summary {
    font-size: 0.85rem;
  }

  .post-arrow {
    align-self: flex-end;
  }
}
