:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --text: #946b45;
  --muted: #946b45;
  --border: #ebebeb;
  --accent: #ff7f83;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --text: #f2f2f2;
    --muted: #a0a0a0;
    --border: #2c2c2c;
    --accent: #c0c0c0;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  line-height: 1.75;
}

a {
  color: #ff7f83;
  text-decoration: none;
}

a:visited {
  color: #ff7f83;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 56px;
}

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin-bottom: 28px;
}

.page-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 1.2rem + 0.6vw, 1.8rem);
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand-link {
  color: #ff7f83;
  text-decoration: none;
}

.brand-link:hover {
  text-decoration: underline;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-nav a {
  color: #ff7f83;
  text-decoration: none;
  font-size: 0.92rem;
}

.header-nav a:hover {
  color: #ff7f83;
  text-decoration: none;
}

.header-nav a[aria-current="page"] {
  color: var(--text);
}

.timeline {
  display: grid;
  gap: 24px;
}

.tag-summary {
  margin: -8px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

.post {
  padding: 0 0 20px;
  border-bottom: 1px solid var(--border);
}

.post h2 {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
}

.post-content {
  margin: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}

.post-content-preview {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 6;
  line-clamp: 6;
  overflow: hidden;
  max-height: calc(1.75em * 6);
}

.post-more {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.read-more-link {
  color: var(--text);
  text-decoration: underline;
}

.post-meta {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.tag {
  color: var(--accent);
}

.tag-button {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
}

.tag-button:hover,
.tag-link:hover {
  text-decoration: underline;
}

.post-time-link {
  color: inherit;
  text-decoration: none;
}

.post-time-link:hover {
  text-decoration: underline;
}

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

.empty-state {
  margin: 0;
  color: var(--muted);
}

.pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  margin-top: 28px;
}

.pagination button {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  border-radius: 999px;
  padding: 3px 12px;
  font: inherit;
  cursor: pointer;
}

.pagination button:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

#page-indicator {
  justify-self: center;
  color: var(--muted);
  font-size: 0.9rem;
}

#prev-page {
  justify-self: start;
}

#next-page {
  justify-self: end;
}

.archive-list {
  display: grid;
  gap: 14px;
}

.archive-year {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.archive-item {
  padding: 0 0 14px;
  border-bottom: 1px solid var(--border);
}

.archive-link {
  display: inline-block;
  color: var(--text);
  text-decoration: none;
  line-height: 1.55;
}

.archive-link:hover {
  text-decoration: underline;
}

.archive-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.88rem;
}

.tag-link {
  text-decoration: none;
}

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

.post-detail {
  border-bottom: 0;
  padding-bottom: 0;
}

.post-detail h2 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 1.25rem + 0.7vw, 2rem);
  font-weight: 700;
  line-height: 1.3;
}

.post-page-container {
  padding-top: 20px;
}

.back-row {
  margin: 0 0 20px;
}

.back-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}

.back-link-prominent {
  display: inline-block;
  padding: 5px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  font-weight: 600;
  font-size: 0.95rem;
}

.back-link:hover {
  color: var(--text);
  text-decoration: underline;
}

.inline-back-link {
  margin-left: 8px;
}
