/* CSS Variables */
:root {
  --font-en: Palatino;
  --font-cn: "LXGW WenKai", serif;
  --font-base: var(--font-en), var(--font-cn);
  --font-code: Consolas, Courier, "Liberation Mono", Menlo, Monaco, "Courier New", monospace;
}

/* Base styles */
body {
  background-color: #fff !important;
}

/* Bold text with highlight */
strong, b {
  font-weight: normal;
  background-color: #fff59d;
  padding: 0.1em 0.2em;
}

/* Article content font */
.nested-copy-line-height,
.nested-links,
article .post-content {
  font-family: var(--font-base);
}

/* Code block container */
.highlight pre {
  margin: 0;
}

.highlight pre code,
pre code {
  display: block;
  padding: 1em;
  overflow-x: auto;
  background-color: #f7f7f7;
  border: 1px solid #f5f5f5;
  border-radius: 6px;
  white-space: pre;
  word-break: normal;
  font-family: var(--font-code);
  font-size: 0.85em;
  line-height: 1.45;
  color: #24292e;
}

/* Inline code */
:not(pre) > code {
  background-color: #f9f9f9;
  padding: 0.2em 0.4em;
  border-radius: 0;
  font-size: 0.9em;
  font-family: var(--font-code);
  color: inherit;
}

/* Links - dashed underline, solid on hover */
body a,
body a:link,
body a:visited {
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  color: inherit;
}

body a:hover,
body a:active {
  border-bottom-style: solid;
}

/* List styling */
article ul,
article ol,
.nested-copy-line-height ul,
.nested-copy-line-height ol {
  padding-left: 1.5em;
  margin: 1em 0;
}

article li,
.nested-copy-line-height li {
  margin-bottom: 0.5em;
  line-height: 1.6;
}

article ul li::marker,
article ol li::marker {
  color: #666;
}

/* Site navigation */
.site-nav {
  max-width: 64em;
  margin: 0 auto 1.5em;
  padding: 0 1rem 1rem;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-nav .site-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #111;
  border-bottom: none;
  font-family: var(--font-en);
}

.site-nav .site-title:hover {
  border-bottom: none;
}

.site-nav .nav-links a {
  color: #666;
  margin-left: 1.5em;
  border-bottom: 1px dashed #666;
  font-family: var(--font-en);
}

.site-nav .nav-links a:hover {
  border-bottom-style: solid;
}

/* Year group */
.year-group {
  margin-bottom: 2em;
}

.year-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: #111;
  margin: 0 0 0.5em 0;
  font-family: var(--font-en);
  border-bottom: none;
}

.category-title {
  font-size: 1.8rem;
  font-weight: 600;
  color: #111;
  margin: 0 0 1em 0;
  font-family: var(--font-base);
}

/* Post list on homepage */
.post-list {
  list-style: none;
  padding: 0;
  margin: 0.5em 0;
  font-family: var(--font-base);
}

.post-list .post-num {
  color: #666;
  margin-right: 0.5em;
  font-size: 0.9em;
}

.post-list .post-title {
  color: #111;
  font-weight: 500;
  border-bottom: 1px dashed #111;
}

.post-list .post-title:hover {
  border-bottom-style: solid;
}

.post-list .post-date {
  color: #666;
  margin-left: 0.8em;
  font-size: 0.9em;
}

.post-list .post-tag {
  background-color: #f1f1f1;
  padding: 0.25em 0.25em;
  border-radius: 3px;
  font-size: 1em;
  margin-left: 0.2em;
  border-bottom: none;
}

/* Single post title */
.post-title-single {
  font-size: 1.75rem;
  font-weight: 600;
  font-family: var(--font-base);
  margin: 1em 0 0.3em;
}

/* Single post content */
.nested-copy-line-height,
.nested-copy-line-height.mid-gray {
  font-size: 1.1rem;
  color: #1d1b1b;
}

.nested-copy-line-height h2 {
  font-size: 1.6rem;
}

.nested-copy-line-height h3 {
  font-size: 1.4rem;
}

.nested-copy-line-height h4 {
  font-size: 1.2rem;
}

/* Single post meta */
.post-meta {
  margin: 0.5em 0 1.5em;
}

.post-date-single {
  color: #666;
  font-size: 1rem;
  font-family: var(--font-en);
}

.post-tags {
  margin-left: 1em;
}

.post-tags .post-tag {
  background-color: #f1f1f1;
  padding: 0.2em 0.5em;
  border-radius: 3px;
  font-size: 1rem;
  margin-left: 0.3em;
  border-bottom: none;
  font-family: var(--font-en);
}

/* Table styles */
.nested-copy-line-height table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.9rem;
}

.nested-copy-line-height table thead {
  background-color: #f6f8fa;
}

.nested-copy-line-height table th {
  border: 1px solid #d0d7de;
  padding: 0.6em 0.8em;
  text-align: left;
  font-weight: 600;
  color: #000;
}

.nested-copy-line-height table td {
  border: 1px solid #d0d7de;
  padding: 0.6em 0.8em;
  text-align: left;
}

.nested-copy-line-height table tbody tr:nth-child(even) {
  background-color: #f6f8fa;
}

.nested-copy-line-height table tbody tr:hover {
  background-color: #f0f0f0;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  pre code {
    background-color: #d6d1cc;
    border-color: #999;
    box-shadow: 5px 5px 5px #ccc;
  }

  :not(pre) > code {
    background-color: #d6d1cc;
  }
}
