:root {
  --bg: #fff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #1d4ed8;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.8;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-container {
  width: min(980px, calc(100% - 2rem));
  margin: 0 auto;
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 58px;
}

.site-brand {
  display: inline-flex;
  flex-direction: column;
  gap: 0;
  color: var(--text);
}

.site-brand__title {
  font-size: 1rem;
  font-weight: 700;
}

.site-brand__slogan {
  font-size: 0.76rem;
  color: var(--muted);
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 4px;
  padding: 0.35rem 0.55rem;
  font-size: 0.86rem;
}

.site-nav__links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 0.4rem;
}

.site-nav__item > a {
  display: inline-block;
  color: #374151;
  border-radius: 4px;
  padding: 0.35rem 0.5rem;
  font-size: 0.9rem;
}

.site-nav__item.is-active > a {
  color: #111827;
  background: #f3f4f6;
}

.site-nav__dropdown {
  display: none;
}

.hero {
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.hero__inner {
  padding: 1.2rem 0 1rem;
}

.hero__kicker {
  margin: 0 0 0.25rem;
  font-size: 0.78rem;
  color: var(--muted);
  letter-spacing: 0.04em;
}

.hero__title {
  margin: 0;
  font-size: clamp(1.3rem, 2.6vw, 1.8rem);
  line-height: 1.35;
}

.hero__caption {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-main {
  padding: 1.1rem 0 2rem;
}

.content-card {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 4px;
  padding: 1rem;
}

.home-intro {
  margin: 0 0 0.85rem;
}

.home-intro__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
}

.home-intro__desc {
  margin: 0.25rem 0 0;
  color: var(--muted);
}

.wiki-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
}

.wiki-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.9rem;
}

.wiki-card__title {
  margin: 0 0 0.65rem;
  font-size: 1rem;
}

.wiki-links,
.wiki-post-list,
.topic-list,
.topic-post-list,
.archive-list,
.search-results,
.post-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.wiki-links li,
.wiki-post-list li,
.topic-post-list li,
.archive-list li,
.search-results li,
.post-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.8rem;
  border-bottom: 1px dashed var(--line);
  padding: 0.45rem 0;
}

.wiki-links li:last-child,
.wiki-post-list li:last-child,
.topic-post-list li:last-child,
.archive-list li:last-child,
.search-results li:last-child,
.post-list li:last-child {
  border-bottom: 0;
}

.wiki-links span,
.wiki-post-list span,
.topic-post-list span,
.archive-list span,
.search-results span,
.post-list span {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
}

.topic-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.topic-card {
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 0.8rem;
}

.topic-card__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
}

.topic-card__more {
  margin: 0.55rem 0 0;
}

.blog-listing__title {
  margin: 0 0 0.7rem;
  font-size: 1.3rem;
}

.post-item {
  border-bottom: 1px dashed var(--line);
  padding: 0.8rem 0;
}

.post-item:last-child {
  border-bottom: 0;
}

.post-item h2,
.post-item h3 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
}

.post-item__meta,
.post-page__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.pager {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
}

.pager a,
.post-nav__link {
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #374151;
  background: #fff;
  padding: 0.28rem 0.55rem;
  font-size: 0.84rem;
}

.post-page__header h1 {
  margin: 0;
  font-size: clamp(1.3rem, 2.5vw, 1.75rem);
}

.post-page__subheadline {
  margin: 0 0 0.25rem;
  color: var(--muted);
}

.post-content {
  margin-top: 0.85rem;
}

.post-content pre {
  overflow: auto;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #f9fafb;
  color: #111827;
  padding: 0.7rem;
}

.post-content img {
  max-width: 100%;
}

.post-meta {
  margin-top: 1rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.7rem;
}

.post-meta__tag {
  display: inline-block;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 0 0.45rem;
  margin-right: 0.25rem;
  font-size: 0.78rem;
  color: #374151;
}

.post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.7rem;
}

.comments-block {
  margin-top: 1.2rem;
  border-top: 1px dashed var(--line);
  padding-top: 0.7rem;
}

.comments-block h2 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
}

.comments-block__hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.search-panel {
  max-width: 760px;
}

.search-panel h2 {
  margin: 0 0 0.25rem;
}

.search-panel p {
  margin: 0 0 0.65rem;
  color: var(--muted);
}

.search-panel__label {
  display: block;
  margin-bottom: 0.25rem;
  color: #4b5563;
  font-size: 0.86rem;
}

#local-search-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  background: #fff;
  font-size: 0.92rem;
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.75rem;
}

#local-search-input:focus {
  outline: 1px solid #93c5fd;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: 1.6rem;
}

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.95rem 0 0.55rem;
}

.site-footer__inner p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.site-footer__meta {
  display: inline-flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.site-footer__copyright {
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0 0 0.95rem;
}

.site-body .row,
.site-body .columns,
.site-body [class*="small-"],
.site-body [class*="medium-"],
.site-body [class*="large-"] {
  float: none;
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0;
}

@media (max-width: 920px) {
  .nav-toggle {
    display: inline-block;
  }

  .site-nav__links {
    display: none;
    position: absolute;
    right: 1rem;
    top: 50px;
    width: min(90vw, 300px);
    flex-direction: column;
    align-items: stretch;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: 4px;
    padding: 0.35rem;
  }

  .site-nav__links.is-open {
    display: flex;
  }

  .site-nav__item > a {
    width: 100%;
  }
}

@media (max-width: 760px) {
  .wiki-grid,
  .topic-list {
    grid-template-columns: 1fr;
  }

  .content-card {
    padding: 0.85rem;
  }

  .site-footer__inner {
    flex-direction: column;
  }
}
