:root {
  --bg-primary: #ffffff;
  --bg-secondary: #fafafa;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e5e5e5;
  --border-hover: #d0d0d0;
  --accent: #000000;
  --accent-hover: #333333;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.1);
  --radius: 4px;
  --transition: 150ms ease;
  --max-width: 720px;
  --header-height: 60px;
}

[data-theme="dark"] {
  --bg-primary: #111111;
  --bg-secondary: #1a1a1a;
  --text-primary: #eeeeee;
  --text-secondary: #999999;
  --text-muted: #666666;
  --border-color: #2a2a2a;
  --border-hover: #3a3a3a;
  --accent: #ffffff;
  --accent-hover: #cccccc;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  --shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--transition), color var(--transition);
}

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

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

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: inherit;
  font-size: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-height);
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  transition: background-color var(--transition), border-color var(--transition);
}

.header-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.7;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  transition: all var(--transition);
}

.theme-toggle:hover {
  background-color: var(--border-color);
  border-color: var(--border-hover);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-toggle svg {
  width: 20px;
  height: 20px;
}

.main {
  flex: 1;
  padding: 48px 0;
}

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

.post-item {
  border-bottom: 1px solid var(--border-color);
  padding: 32px 0;
  transition: background-color var(--transition);
}

.post-item:first-child {
  border-top: 1px solid var(--border-color);
}

.post-item:hover {
  background-color: var(--bg-secondary);
}

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

.post-link:hover {
  text-decoration: none;
}

.post-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.post-title {
  font-size: 1.5rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
  transition: color var(--transition);
}

.post-link:hover .post-title {
  color: var(--accent);
}

.post-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.post-preview {
  font-size: 1rem;
  line-height: 1.7;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-content {
  font-size: 1.125rem;
  line-height: 1.8;
}

.post-header {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
}

.post-full-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.post-full-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.post-body {
  font-size: 1.125rem;
  line-height: 1.8;
}

.post-body h1 {
  font-size: 2rem;
  font-weight: 700;
  margin: 48px 0 24px;
  line-height: 1.3;
}

.post-body h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 40px 0 20px;
  line-height: 1.4;
}

.post-body h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 16px;
  line-height: 1.4;
}

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

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

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

.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.5em;
  margin: 1.5em 0;
  color: var(--text-secondary);
  font-style: italic;
}

.post-body code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-size: 0.9em;
  background-color: var(--bg-secondary);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--border-color);
}

.post-body pre {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 1.5em;
  overflow-x: auto;
  margin: 1.5em 0;
}

.post-body pre code {
  background: none;
  padding: 0;
  border: none;
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-body hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 2.5em 0;
}

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

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

.post-body u {
  text-decoration: underline;
}

.post-body del {
  text-decoration: line-through;
}

.post-body a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body mark.selection-highlight {
  background-color: #fff3cd;
  padding: 0 2px;
  border-radius: 2px;
}

[data-theme="dark"] .post-body mark.selection-highlight {
  background-color: #664d00;
}

.footer {
  padding: 32px 0;
  border-top: 1px solid var(--border-color);
  margin-top: auto;
}

.footer-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 24px;
}

.footer-links a {
  color: var(--text-secondary);
}

.footer-links a:hover {
  color: var(--text-primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  transition: all var(--transition);
  white-space: nowrap;
}

.btn:hover {
  background-color: var(--border-color);
  border-color: var(--border-hover);
  text-decoration: none;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background-color: var(--accent);
  color: var(--bg-primary);
  border-color: var(--accent);
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--bg-primary);
}

.btn-danger {
  color: #dc2626;
  border-color: #dc2626;
}

.btn-danger:hover {
  background-color: #fef2f2;
  border-color: #dc2626;
}

[data-theme="dark"] .btn-danger:hover {
  background-color: #450a0a;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8125rem;
}

.btn-icon {
  padding: 8px;
  width: 40px;
  height: 40px;
}

.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 12px 20px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  font-size: 0.875rem;
  z-index: 1000;
  animation: slideIn 200ms ease;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .main {
    padding: 32px 0;
  }
  
  .post-title {
    font-size: 1.25rem;
  }
  
  .post-full-title {
    font-size: 1.5rem;
  }
  
  .post-body {
    font-size: 1rem;
  }
  
  .post-body h1 {
    font-size: 1.5rem;
  }
  
  .post-body h2 {
    font-size: 1.25rem;
  }
  
  .post-body h3 {
    font-size: 1.125rem;
  }
  
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .toast {
    left: 16px;
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .post-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  
  .post-date {
    font-size: 0.8125rem;
  }
}