/* === Reset & Base === */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  line-height: 1.6;
  color: #24292f;
  background: #f6f8fa;
}

a { color: #0969da; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* === Top Nav === */
.navbar {
  background: #24292f;
  padding: 0;
  position: sticky; top: 0; z-index: 100;
}
.navbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
}
.nav-logo {
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.nav-logo:hover { text-decoration: none; color: #e6edf3; }
.nav-links { display: flex; gap: 1.25rem; }
.nav-links a { color: #8b949e; font-size: 0.85rem; }
.nav-links a:hover { color: #e6edf3; text-decoration: none; }
.nav-search {
  background: #484f58;
  border: none;
  color: #e6edf3;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  font-size: 0.8rem;
  width: 140px;
}
.nav-search::placeholder { color: #8b949e; }
.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.lang-switch {
  color: #f0f6fc;
  background: #388bfd;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}
.lang-switch:hover { background: #58a6ff; text-decoration: none; color: #fff; }

/* === Hero === */
.hero {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 2.5rem 1rem;
  color: #fff;
  margin-bottom: 1.5rem;
}
.hero .container { max-width: 900px; }
.hero h1 { font-size: 1.5rem; margin-bottom: 0.4rem; }
.hero p { opacity: 0.9; font-size: 0.95rem; margin-bottom: 1rem; }
.hero-stats { display: flex; gap: 1rem; }
.hero-stat {
  background: rgba(255,255,255,0.2);
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
}

/* === Stats Bar === */
.stats-bar {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  font-size: 0.8rem;
  color: #656d76;
}

/* === Board Card === */
.board {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  margin-bottom: 1.25rem;
  overflow: hidden;
  background: #fff;
}
.board-header {
  background: #f6f8fa;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #d0d7de;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.board-header .board-icon { font-size: 1.1rem; }
.board-header .board-name { font-weight: 700; font-size: 0.95rem; }
.board-header .board-desc { color: #656d76; font-size: 0.8rem; margin-left: 0.25rem; }
.board-header .board-count {
  margin-left: auto;
  color: #656d76;
  font-size: 0.75rem;
  white-space: nowrap;
}

/* === Post Row === */
.post-row {
  display: flex;
  align-items: center;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid #f0f0f0;
  font-size: 0.88rem;
  color: #24292f;
}
.post-row:last-child { border-bottom: none; }
.post-row:hover { background: #f6f8fa; text-decoration: none; }
.post-pin { width: 2rem; font-size: 0.75rem; flex-shrink: 0; }
.post-pin.pinned { color: #d73a49; }
.post-pin.hot { color: #d73a49; }
.post-title { flex: 1; }
.post-title a { color: #0969da; }
.post-replies { width: 4rem; text-align: center; color: #656d76; font-size: 0.8rem; flex-shrink: 0; }
.post-date { width: 3.5rem; text-align: right; color: #656d76; font-size: 0.75rem; flex-shrink: 0; }

/* === Category Page === */
.breadcrumb {
  font-size: 0.8rem;
  color: #656d76;
  margin-bottom: 1rem;
  padding-top: 1rem;
}
.breadcrumb a { color: #0969da; }

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.page-header h2 { font-size: 1.3rem; display: flex; align-items: center; gap: 0.5rem; }
.page-header .post-count { color: #656d76; font-size: 0.85rem; }

.sort-select {
  background: #f6f8fa;
  border: 1px solid #d0d7de;
  padding: 0.35rem 0.6rem;
  border-radius: 6px;
  font-size: 0.8rem;
  color: #24292f;
}

/* === Post Table (Category Page) === */
.post-table {
  border: 1px solid #d0d7de;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}
.post-table-header {
  background: #f6f8fa;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid #d0d7de;
  display: flex;
  font-size: 0.75rem;
  color: #656d76;
  font-weight: 600;
}
.post-table-header .col-pin { width: 3rem; flex-shrink: 0; }
.post-table-header .col-title { flex: 1; }
.post-table-header .col-replies { width: 5rem; text-align: center; flex-shrink: 0; }
.post-table-header .col-date { width: 5rem; text-align: right; flex-shrink: 0; }

/* === Article Detail === */
.article-container { max-width: 750px; }

.article-tags { margin-bottom: 0.75rem; display: flex; gap: 0.4rem; flex-wrap: wrap; }
.tag-pin {
  background: #ddf4ff;
  color: #0969da;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
}
.tag-cat {
  background: #f6f8fa;
  color: #656d76;
  padding: 0.15rem 0.6rem;
  border-radius: 12px;
  font-size: 0.75rem;
}

.article-title { font-size: 1.5rem; margin: 0.75rem 0 0.4rem; }
.article-meta { color: #656d76; font-size: 0.8rem; margin-bottom: 2rem; }

.article-body {
  line-height: 1.8;
  font-size: 1rem;
}
.article-body h2 { font-size: 1.2rem; margin: 2rem 0 0.75rem; }
.article-body h3 { font-size: 1.05rem; margin: 1.5rem 0 0.5rem; }
.article-body p { margin-bottom: 1rem; }
.article-body ul, .article-body ol { margin-bottom: 1rem; padding-left: 1.5rem; }
.article-body li { margin-bottom: 0.4rem; }
.article-body code {
  background: #f6f8fa;
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.9em;
}
.article-body pre {
  background: #1b1f23;
  color: #e6edf3;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
  margin-bottom: 1rem;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1rem;
}
.article-body th, .article-body td {
  border: 1px solid #d0d7de;
  padding: 0.5rem 0.75rem;
  text-align: left;
  font-size: 0.9rem;
}
.article-body th { background: #f6f8fa; font-weight: 600; }

/* === Related Posts === */
.related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #d0d7de;
}
.related h3 { font-size: 1rem; margin-bottom: 0.75rem; }
.related-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}
.related-card {
  display: block;
  padding: 0.75rem 1rem;
  border: 1px solid #d0d7de;
  border-radius: 6px;
  color: #0969da;
  font-size: 0.88rem;
}
.related-card:hover { background: #f6f8fa; text-decoration: none; }

/* === Footer === */
.footer {
  text-align: center;
  padding: 2.5rem 1rem;
  color: #656d76;
  font-size: 0.8rem;
  margin-top: 2rem;
  border-top: 1px solid #d0d7de;
}
.footer p { margin-bottom: 0.3rem; }

/* === Responsive === */
@media (max-width: 768px) {
  .hero { padding: 1.5rem 1rem; }
  .hero h1 { font-size: 1.2rem; }
  .nav-links { display: none; }
  .nav-search { width: 100px; }
  .post-row { font-size: 0.82rem; }
  .post-replies, .post-date { width: auto; }
  .related-grid { grid-template-columns: 1fr; }
  .article-title { font-size: 1.2rem; }
  .board-header { flex-wrap: wrap; }
  .board-header .board-desc { display: none; }
}
