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

:root {
  --paper: #faf8f5;
  --ink: #1a1a1a;
  --ink-light: #6b6560;
  --ink-faint: #c4beb8;
  --accent: #8b4513;
  --max-width: 640px;
}

html {
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'LXGW WenKai', 'Crimson Pro', Georgia, serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.9;
  min-height: 100vh;
  padding: 0 1.5rem;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 0 6rem;
}

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

/* === Site Header (Index) === */
.site-header {
  margin-bottom: 4rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--ink-faint);
}

.site-header h1 {
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 0.3rem;
}

.site-header .tagline {
  font-family: 'Crimson Pro', Georgia, serif;
  font-style: italic;
  color: var(--ink-light);
  font-size: 1.05rem;
}

/* === Post List === */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.post-item {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--ink-faint);
}

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

.post-item a {
  display: block;
  transition: opacity 0.2s;
}

.post-item a:hover {
  opacity: 0.65;
}

.post-item time {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.85rem;
  color: var(--ink-light);
  letter-spacing: 0.04em;
}

.post-item h2 {
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.4;
  margin-top: 0.25rem;
}

.post-item .subtitle {
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-top: 0.2rem;
  line-height: 1.5;
}

.empty {
  color: var(--ink-light);
  font-style: italic;
}

/* === Post Page === */
.post-header {
  margin-bottom: 3rem;
}

.post-header .back {
  display: inline-block;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  color: var(--ink-light);
  margin-bottom: 2rem;
  transition: color 0.2s;
}

.post-header .back:hover {
  color: var(--ink);
}

.post-header time {
  display: block;
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.85rem;
  color: var(--ink-light);
  letter-spacing: 0.04em;
  margin-bottom: 0.5rem;
}

.post-header h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0.01em;
}

.post-header .subtitle {
  font-size: 1.1rem;
  color: var(--ink-light);
  margin-top: 0.4rem;
  font-style: italic;
  font-family: 'Crimson Pro', Georgia, serif;
}

/* === Post Body === */
.post-body {
  font-size: 1rem;
  line-height: 1.9;
}

.post-body p {
  margin-bottom: 1.5em;
  text-align: justify;
}

.post-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 3rem;
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--ink-faint);
}

.post-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.8rem;
}

.post-body ul, .post-body ol {
  margin-bottom: 1.5em;
  padding-left: 1.5em;
}

.post-body li {
  margin-bottom: 0.4em;
}

.post-body blockquote {
  margin: 2em 0;
  padding: 0.8em 1.2em;
  border-left: 3px solid var(--ink-faint);
  color: var(--ink-light);
  font-style: italic;
}

.post-body strong {
  font-weight: 700;
}

.post-body em {
  font-style: italic;
}

.post-body code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 0.85em;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

.post-body pre {
  margin: 1.5em 0;
  padding: 1.2em 1.4em;
  background: #2d2a26;
  color: #e8e0d8;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.85em;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-body hr {
  border: none;
  text-align: center;
  margin: 2.5em 0;
}

.post-body hr::after {
  content: '·  ·  ·';
  color: var(--ink-faint);
  letter-spacing: 0.3em;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5em 0;
  font-size: 0.92em;
}

.post-body th, .post-body td {
  padding: 0.5em 0.8em;
  text-align: left;
  border-bottom: 1px solid var(--ink-faint);
}

.post-body th {
  font-weight: 700;
  font-size: 0.85em;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-light);
}

/* === Drop Cap === */
.drop-cap {
  float: left;
  font-size: 3.6em;
  line-height: 0.8;
  padding-right: 0.08em;
  padding-top: 0.07em;
  font-weight: 700;
  color: var(--ink);
}

/* === Post Footer === */
.post-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  text-align: center;
}

.post-footer .separator {
  color: var(--ink-faint);
  letter-spacing: 0.3em;
  margin-bottom: 1.5rem;
}

.post-footer .back {
  font-family: 'Crimson Pro', Georgia, serif;
  font-size: 0.9rem;
  color: var(--ink-light);
  transition: color 0.2s;
}

.post-footer .back:hover {
  color: var(--ink);
}

/* === Mobile === */
@media (max-width: 600px) {
  html { font-size: 16px; }
  main { padding: 2.5rem 0 4rem; }
  .site-header { margin-bottom: 2.5rem; }
  .site-header h1 { font-size: 1.8rem; }
  .post-header h1 { font-size: 1.6rem; }
  .drop-cap { font-size: 2.8em; }
}
