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

body {
  font-family: 'Segoe UI', 'Hiragino Sans', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
  line-height: 1.8;
  color: #333;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  min-height: 100vh;
}

header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 2rem 1rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.site-title {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.site-title a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s;
}

.site-title a:hover {
  opacity: 0.9;
}

nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 0;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}

nav a:hover {
  opacity: 0.8;
}

.blog-container {
  max-width: 1400px;
  margin: 3rem auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
}

.main-content {
  background: white;
  padding: 3rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.08);
}

.main-content h1 {
  font-size: 2.2rem;
  line-height: 1.4;
  margin-bottom: 1rem;
  color: #1a1a2e;
  font-weight: 700;
}

.post-meta {
  color: #666;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #f0f0f0;
}

.post-meta time {
  font-size: 0.95rem;
}

.blog-hero-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 8px;
  margin: 2rem 0;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.main-content h2 {
  font-size: 1.8rem;
  margin: 3rem 0 1.5rem;
  color: #667eea;
  border-left: 5px solid #667eea;
  padding-left: 1rem;
  font-weight: 700;
}

.main-content h3 {
  font-size: 1.4rem;
  margin: 2.5rem 0 1rem;
  color: #444;
  font-weight: 600;
}

.main-content p {
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
  line-height: 1.9;
}

.main-content ul {
  margin: 1.5rem 0 1.5rem 2rem;
  line-height: 2;
}

.main-content li {
  margin-bottom: 0.8rem;
  font-size: 1.05rem;
}

.main-content strong {
  color: #667eea;
  font-weight: 600;
}

.code-example {
  background: #f8f9fa;
  border-left: 4px solid #667eea;
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: 6px;
}

.code-example pre {
  overflow-x: auto;
  font-family: 'Courier New', monospace;
  font-size: 0.9rem;
  line-height: 1.6;
  color: #2d3748;
}

.code-example code {
  display: block;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.sidebar {
  position: sticky;
  top: 2rem;
  align-self: start;
}

.toc {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  margin-bottom: 2rem;
}

.toc h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #667eea;
  font-weight: 700;
}

.toc ul {
  list-style: none;
  padding: 0;
}

.toc > ul > li {
  margin-bottom: 0.8rem;
}

.toc li ul {
  margin-left: 1rem;
  margin-top: 0.5rem;
}

.toc li ul li {
  margin-bottom: 0.5rem;
}

.toc a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.95rem;
}

.toc a:hover {
  color: #667eea;
}

.ad-space {
  background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
  padding: 2rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 2rem;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.ad-space p {
  color: #666;
  font-weight: 500;
}

.related-articles {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.related-articles h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #667eea;
  font-weight: 700;
}

.related-articles ul {
  list-style: none;
  padding: 0;
}

.related-articles li {
  margin-bottom: 1rem;
}

.related-articles a {
  color: #555;
  text-decoration: none;
  transition: color 0.3s;
  font-size: 0.95rem;
}

.related-articles a:hover {
  color: #667eea;
}

footer {
  background: #1a1a2e;
  color: white;
  padding: 2rem;
  text-align: center;
  margin-top: 4rem;
}

footer a {
  color: #667eea;
  text-decoration: none;
  transition: opacity 0.3s;
}

footer a:hover {
  opacity: 0.8;
}

footer p {
  margin-bottom: 0.5rem;
}

@media (max-width: 1024px) {
  .blog-container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .sidebar {
    position: static;
  }
  
  nav ul {
    gap: 1rem;
  }
}

@media (max-width: 768px) {
  .main-content {
    padding: 2rem 1.5rem;
  }
  
  .main-content h1 {
    font-size: 1.8rem;
  }
  
  .main-content h2 {
    font-size: 1.5rem;
  }
  
  .main-content h3 {
    font-size: 1.2rem;
  }
  
  .blog-container {
    padding: 0 1rem;
    margin: 2rem auto;
  }
  
  header {
    padding: 1.5rem 1rem;
  }
  
  .site-title {
    font-size: 1.4rem;
  }
  
  nav ul {
    flex-direction: column;
    gap: 0.5rem;
  }
}
