:root {
  --text: #1f1f1f;
  --text-muted: #737373;
  --border: #e0e0e0;
  --bg: #e8e8e8;
  --surface: #ffffff;
  --surface-header: #ffffff;
  --accent: #404040;
  --accent-hover: #1a1a1a;
  --max-width: 700px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.05), 0 6px 20px rgba(0, 0, 0, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', Georgia,
    'Times New Roman', serif;
  font-size: 15px;
  line-height: 1.85;
  letter-spacing: 0.03em;
  color: var(--text);
  background: var(--bg);
  background-image: linear-gradient(180deg, #dedede 0%, var(--bg) 12rem);
}

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

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

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface-header);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.site-title {
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.08em;
}

.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}

nav a {
  margin-left: 1.25rem;
  color: var(--text-muted);
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

nav a:hover,
nav a.active {
  color: var(--text);
  text-decoration: none;
}

main.container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 2.25rem 2rem 2.5rem;
  margin-bottom: 2.5rem;
}

.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-preview {
  padding: 1.25rem 0;
  border-bottom: 1px dashed var(--border);
}

.post-preview:first-child {
  padding-top: 0;
}

.post-preview:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.post-preview h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.post-preview h2 a {
  color: var(--text);
}

.post-preview h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.post-preview time,
.post-header time {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.post-excerpt {
  margin: 0.6rem 0 0;
  font-size: 0.875rem;
  line-height: 1.75;
  color: var(--text-muted);
  text-align: left;
}

.tags {
  margin: 0.5rem 0 0;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--text-muted);
  background: #f5f5f5;
  border: 1px solid var(--border);
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  margin-right: 0.375rem;
  letter-spacing: 0.02em;
}

.post-header {
  margin-bottom: 2rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--border);
}

.post-header h1 {
  margin: 0 0 0.5rem;
  font-size: 1.625rem;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: 0.05em;
}

.post-content h2 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.04em;
}

.post-content h3 {
  font-size: 1rem;
  font-weight: 600;
  margin: 1.5rem 0 0.5rem;
  letter-spacing: 0.03em;
}

.post-content p {
  margin: 0 0 1rem;
  text-align: justify;
  text-justify: inter-ideograph;
}

.post-content ul,
.post-content ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.post-content img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--border);
  background: #fff;
}

.post-content pre {
  background: #f5f5f5;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.8125rem;
  line-height: 1.6;
  letter-spacing: 0;
}

.post-content code {
  font-family: 'SF Mono', 'Fira Code', 'Courier New', Consolas, monospace;
  font-size: 0.84em;
  background: #f5f5f5;
  border: 1px solid var(--border);
  padding: 0.1rem 0.35rem;
  border-radius: 2px;
  letter-spacing: 0;
}

.post-content pre code {
  background: none;
  border: none;
  padding: 0;
}

.post-content blockquote {
  margin: 0 0 1rem;
  padding: 0.5rem 0 0.5rem 1rem;
  border-left: 3px solid #bdbdbd;
  background: #f7f7f7;
  color: var(--text-muted);
}

.archive-year h2 {
  font-size: 1rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.archive-year:first-child h2 {
  margin-top: 0;
}

.archive-year ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.archive-year li {
  display: flex;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed var(--border);
}

.archive-year li:last-child {
  border-bottom: none;
}

.archive-year time {
  flex-shrink: 0;
  width: 7rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.site-footer {
  padding: 0 0 2rem;
  margin-top: 0;
}

.site-footer .container {
  text-align: center;
}

.site-footer p {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.site-footer a {
  color: var(--text-muted);
}

.search-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.search-input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  font: inherit;
  font-size: 0.9375rem;
  color: var(--text);
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 6px;
  outline: none;
}

.search-input:focus {
  border-color: #bdbdbd;
  background: #fff;
}

.search-status {
  margin: 0.75rem 0 1.25rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.search-results {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.search-result {
  padding: 1.25rem 0;
  border-bottom: 1px dashed var(--border);
}

.search-result:first-child {
  padding-top: 0;
}

.search-result:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.search-result h2 {
  margin: 0 0 0.35rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.search-result h2 a {
  color: var(--text);
}

.search-result h2 a:hover {
  color: var(--accent);
  text-decoration: none;
}

@media (max-width: 480px) {
  main.container {
    padding: 1.5rem 1.25rem 2rem;
    border-radius: 6px;
  }

  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  nav a {
    margin-left: 0;
    margin-right: 1rem;
  }

  .archive-year li {
    flex-direction: column;
    gap: 0.25rem;
  }

  .archive-year time {
    width: auto;
  }
}
