/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  line-height: 1.8;
  color: #333;
  background: #fff;
}

a {
  color: #2563eb;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.wrapper {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid #e5e7eb;
  padding: 1.5rem 0;
  margin-bottom: 2rem;
}

.site-header .wrapper {
  max-width: 960px;
}

.site-title {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.site-title a {
  color: #111;
}

.site-title a:hover {
  text-decoration: none;
}

.site-description {
  font-size: 0.875rem;
  color: #6b7280;
  font-weight: normal;
  margin-bottom: 1rem;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.125rem;
}

.main-nav li a {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  font-size: 0.875rem;
  color: #374151;
  border-radius: 4px;
}

.main-nav li a:hover {
  background: #f3f4f6;
  text-decoration: none;
}

.main-nav li.active a {
  background: #2563eb;
  color: #fff;
}

/* Footer */
.site-footer {
  border-top: 1px solid #e5e7eb;
  padding: 1.5rem 0;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.8125rem;
  color: #9ca3af;
}

.site-footer a {
  color: #6b7280;
}

.site-footer p {
  margin: 0.25rem 0;
}

/* Post List */
.post-list {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.post-card {
  border-bottom: 1px solid #f3f4f6;
  padding-bottom: 2.5rem;
}

.post-card:last-child {
  border-bottom: none;
}

.post-card-image {
  margin-bottom: 1rem;
}

.post-card-image img {
  width: 100%;
  border-radius: 4px;
}

.post-card-title {
  font-size: 1.375rem;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

.post-card-title a {
  color: #111;
}

.post-card-title a:hover {
  color: #2563eb;
  text-decoration: none;
}

.post-card-meta {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-bottom: 0.75rem;
}

.post-card-meta span + span::before {
  content: " · ";
}

.post-card-meta a {
  color: #6b7280;
}

.post-card-excerpt {
  color: #4b5563;
  font-size: 0.9375rem;
}

.post-card-excerpt p {
  margin-bottom: 0.5rem;
}

.read-more {
  font-size: 0.875rem;
  color: #2563eb;
}

/* Archive Header */
.archive-header h1 {
  font-size: 1.25rem;
  color: #6b7280;
  font-weight: normal;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
}

.archive-header .arrow {
  color: #9ca3af;
}

.archive-header span:last-child {
  color: #111;
  font-weight: 600;
}

/* Single Post */
.post-single {
  margin-bottom: 2rem;
}

.featured-image {
  margin-bottom: 1.5rem;
}

.featured-image img {
  width: 100%;
  border-radius: 4px;
}

.post-header {
  margin-bottom: 2rem;
}

.post-title {
  font-size: 1.75rem;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}

.post-meta {
  font-size: 0.8125rem;
  color: #9ca3af;
}

.post-meta span + span::before {
  content: " · ";
}

.post-meta a {
  color: #6b7280;
}

/* Post Content */
.post-content {
  font-size: 1rem;
  line-height: 1.8;
}

.post-content h2 {
  font-size: 1.375rem;
  margin: 2rem 0 1rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid #f3f4f6;
}

.post-content h3 {
  font-size: 1.125rem;
  margin: 1.5rem 0 0.75rem;
}

.post-content p {
  margin-bottom: 1rem;
}

.post-content ul, .post-content ol {
  margin-bottom: 1rem;
  padding-left: 2rem;
}

.post-content li {
  margin-bottom: 0.25rem;
}

.post-content blockquote {
  border-left: 3px solid #e5e7eb;
  padding: 0.5rem 1rem;
  margin: 1rem 0;
  color: #6b7280;
  font-style: italic;
}

.post-content blockquote cite {
  display: block;
  font-size: 0.875rem;
  margin-top: 0.5rem;
  font-style: normal;
  color: #9ca3af;
}

.post-content code {
  background: #f3f4f6;
  padding: 0.125rem 0.375rem;
  border-radius: 3px;
  font-size: 0.875em;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.post-content pre {
  background: #1f2937;
  color: #e5e7eb;
  padding: 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 1rem 0;
  font-size: 0.875rem;
  line-height: 1.6;
}

.post-content pre code {
  background: none;
  padding: 0;
  color: inherit;
}

.post-content figure {
  margin: 1.5rem 0;
  text-align: center;
}

.post-content figure.alignright {
  float: right;
  margin: 0 0 1rem 1.5rem;
  max-width: 300px;
}

.post-content figure.alignleft {
  float: left;
  margin: 0 1.5rem 1rem 0;
  max-width: 300px;
}

.post-content figure img {
  border-radius: 4px;
}

.post-content figcaption {
  font-size: 0.8125rem;
  color: #9ca3af;
  margin-top: 0.5rem;
}

.post-content video {
  width: 100%;
  border-radius: 4px;
  margin: 1rem 0;
}

.post-content img {
  display: block;
  margin: 1.5rem auto;
  border-radius: 4px;
}

/* Page Content */
.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 1.75rem;
}

/* Alert Component */
.alert {
  padding: 0.875rem 1rem;
  border-radius: 6px;
  margin: 1rem 0;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.alert-info {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
}

.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
}

.alert-success {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
}

.alert-standard {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  color: #374151;
}

.alert a {
  text-decoration: underline;
}

/* Button Component */
.btn {
  display: inline-block;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  margin: 0.25rem 0.25rem 0.25rem 0;
  transition: opacity 0.15s;
}

.btn:hover {
  opacity: 0.85;
  text-decoration: none;
}

.btn-grass {
  background: #22c55e;
  color: #fff;
}

.btn-blue {
  background: #3b82f6;
  color: #fff;
}

.btn-light {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #d1d5db;
}

/* Project Action */
.project-action {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  padding: 1rem;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Steam Widget */
.post-content iframe[src*="store.steampowered.com"] {
  display: block;
  margin: 1rem 0;
  border-radius: 4px;
}

/* Responsive */
@media (max-width: 640px) {
  .main-nav ul {
    gap: 0;
  }

  .main-nav li a {
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
  }

  .post-title {
    font-size: 1.375rem;
  }

  .post-content figure.alignright,
  .post-content figure.alignleft {
    float: none;
    max-width: 100%;
    margin: 1.5rem 0;
  }
}
