:root {
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --sub: #64748b;
  --accent: #2563eb;
  --accent-bg: #eff6ff;
  --border: #e2e8f0;
}

* { box-sizing: border-box; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Sans", "Noto Sans JP", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  line-height: 1.85;
  overflow-wrap: break-word;
}

header {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 18px 24px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.site-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.site-title span { color: var(--accent); }

nav a {
  color: var(--sub);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  margin-left: 20px;
}

nav a:hover { color: var(--accent); }

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

/* プロフィール */
.profile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #fff;
  font-size: 1.3rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.profile h1 { margin: 0 0 4px; font-size: 1.15rem; }
.profile p { margin: 0; font-size: 0.9rem; color: var(--sub); }

/* 記事一覧 */
.section-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--sub);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.post-list {
  display: grid;
  gap: 16px;
}

.post-card {
  display: block;
  text-decoration: none;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.post-card:hover {
  transform: translateY(-2px);
  border-color: #cbd5e1;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
}

.post-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: var(--sub);
}

.tag {
  background: var(--accent-bg);
  color: var(--accent);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
}

.post-card h2,
.post-card h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
  line-height: 1.45;
}

.post-card p {
  margin: 0;
  color: var(--sub);
  font-size: 0.92rem;
}

/* 個別記事ページ */
.article-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px 32px;
}

.back-link {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

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

.article-wrap h1 {
  margin: 10px 0 28px;
  font-size: 1.65rem;
  line-height: 1.45;
}

.article-body p { margin: 0 0 18px; }

.article-body h2 {
  font-size: 1.25rem;
  margin: 34px 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.article-body h3 {
  font-size: 1.08rem;
  margin: 24px 0 10px;
}

.article-body ul, .article-body ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.article-body li { margin-bottom: 8px; }

.article-body code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  word-break: break-all;
}

/* 画像・図解 */
.article-body figure {
  margin: 24px 0;
  text-align: center;
}

.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.article-body figcaption {
  font-size: 0.85rem;
  color: var(--sub);
  margin-top: 8px;
}

/* 比較表 */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.92rem;
  display: block;
  overflow-x: auto;
}

.article-body th,
.article-body td {
  border: 1px solid var(--border);
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
}

.article-body th {
  background: #f1f5f9;
  font-weight: 700;
}

/* 注意点・ポイント枠 */
.callout,
.tip-box {
  background: var(--accent-bg);
  border-left: 4px solid var(--accent);
  padding: 16px 20px;
  border-radius: 0 8px 8px 0;
  margin: 24px 0;
  font-size: 0.95rem;
}

footer {
  text-align: center;
  color: var(--sub);
  font-size: 0.85rem;
  padding: 40px 20px;
}

@media (max-width: 600px) {
  .profile { flex-direction: column; align-items: flex-start; gap: 12px; }
  .article-wrap { padding: 24px 20px; }
  .article-wrap h1 { font-size: 1.35rem; }
}
