* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f5f5f5;
  color: #222;
}

a {
  color: #1a73e8;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.site-header {
  background: #24292f;
  color: #fff;
  padding: 16px 0;
}

.site-header-inner {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.site-header-inner {
  width: 1200px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

.site-title {
  margin: 0;
  font-size: 24px;
}

.site-title a {
  color: #fff;
}

.site-description {
  margin: 4px 0 0;
  font-size: 14px;
  opacity: 0.8;
}

.site-main {
  width: 1200px;
  max-width: 100%;
  margin: 24px auto 40px;
  padding: 0 16px;
}

.site-footer {
  text-align: center;
  padding: 16px;
  font-size: 12px;
  color: #777;
}

.post-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-card {
  background: #fff;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.post-title {
  margin: 0 0 4px;
  font-size: 20px;
}

.post-meta {
  font-size: 12px;
  color: #777;
  margin-bottom: 8px;
}

.post-meta .post-author {
  margin-left: 8px;
}

.tag-list {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.tag-item {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
}

.post-summary {
  margin: 0;
  font-size: 14px;
  color: #333;
}

.post-article {
  background: #fff;
  border-radius: 8px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.post-header {
  margin-bottom: 16px;
}

.post-content {
  font-size: 14px;
  line-height: 1.7;
}

/* インラインコード（GitHub風） */
.post-content code {
  padding: 2px 6px;
  background: #f6f8fa;
  color: #24292f;
  border-radius: 3px;
  font-size: 85%;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  border: 1px solid #d0d7de;
}

.post-content pre {
  padding: 8px 12px;
  border-radius: 6px;
  background: #272822;
  color: #f8f8f2;
  overflow-x: auto;
  font-size: 13px;
  position: relative;
}

.post-content pre code {
  display: block;
  padding: 0;
  background: transparent;
  color: inherit;
  border-radius: 0;
  font-size: 13px;
  border: none;
}

/* 表（GitHub風） */
.post-content table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
  margin: 16px 0;
  overflow: auto;
  border: 1px solid #d0d7de;
}

.post-content table th {
  background-color: #f6f8fa;
  text-align: left;
  padding: 6px 13px;
  border: 1px solid #d0d7de;
  font-weight: 600;
}

.post-content table td {
  padding: 6px 13px;
  border: 1px solid #d0d7de;
}

.post-content table tr {
  border-top: 1px solid #d0d7de;
}

.post-content table tr:nth-child(2n) {
  background-color: #f6f8fa;
}

.line-number {
  display: inline-block;
  width: 30px;
  padding-right: 12px;
  margin-right: 12px;
  text-align: right;
  color: #888;
  font-size: 12px;
  user-select: none;
  border-right: 1px solid #444;
}

/* Syntax Highlighting (Rouge) */
.highlight .c1 { color: #75715e; } /* Comment */
.highlight .k { color: #66d9ef; } /* Keyword */
.highlight .n { color: #f8f8f2; } /* Name */
.highlight .p { color: #f8f8f2; } /* Punctuation */
.highlight .kt { color: #66d9ef; } /* Keyword Type */
.highlight .nf { color: #a6e22e; } /* Name Function */
.highlight .s { color: #e6db74; } /* String */
.highlight .mi { color: #ae81ff; } /* Number Integer */
.highlight .o { color: #f92672; } /* Operator */
.highlight .nb { color: #f8f8f2; } /* Name Builtin */
.highlight .m { color: #ae81ff; } /* Number */

/* HSP Syntax Highlighting */
.hsp-comment {
  color: #7cfc00; /* ライムグリーン */
  font-style: italic;
}

.hsp-prep {
  color: #d17d49; /* オレンジ */
  font-weight: bold;
}

.hsp-macro {
  color: #7eb3d4; /* 薄い青 */
}

.hsp-instr,
.hsp-func {
  color: #0099ff; /* 濃いめの青 */
  font-weight: bold;
}

.hsp-label {
  color: #f92672; /* ピンク */
  font-weight: bold;
}

.copy-button {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #444;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  opacity: 0.7;
}

.copy-button:hover {
  opacity: 1;
}

/* レイアウト全体 */
.layout-main {
  display: flex;
  gap: 20px;
}

/* メインカラムとサイドバー */
.main-column {
  flex: 1 1 auto;
  min-width: 0;
}

.side-column {
  flex: 0 0 280px;
}

/* サイドバーのボックス */
.side-box {
  background: #fff;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.side-box h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.side-box p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}

.side-note {
  margin-top: 8px;
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

.side-tag-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.side-tag-list li {
  margin-bottom: 4px;
}

.side-tag-list a {
  text-decoration: none;
}

.side-tag-list a:hover {
  text-decoration: underline;
}

.tag-count {
  color: #777;
  font-size: 11px;
  margin-left: 4px;
}

.search-box {
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
}

#post-search-keyword,
#post-search-tag {
  flex: 1;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 6px;
  border: 1px solid #ccc;
}

.post-submit-section {
  text-align: center;
  margin-bottom: 16px;
}

.post-submit-button {
  display: inline-block;
  padding: 10px 20px;
  border-radius: 8px;
  background: #1a73e8;
  color: #fff;
  font-size: 16px;
  font-weight: bold;
  text-decoration: none;
}

.post-submit-button:hover {
  background: #1558ad;
}

.post-primary-button {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 999px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
}

.post-primary-button:hover {
  text-decoration: none;
  background: #1558ad;
}

.post-secondary-link {
  font-size: 14px;
}

/* サイドバーの記事リスト */
.side-article-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.side-article-list li {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid #eee;
}

.side-article-list li:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.side-article-list a {
  display: block;
  text-decoration: none;
  color: #1a73e8;
  line-height: 1.4;
}

.side-article-list a:hover {
  text-decoration: underline;
}

.side-post-date {
  font-size: 11px;
  color: #999;
  margin-top: 2px;
}

/* サイドバーのタグクラウド */
.side-tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.side-tag-item {
  display: inline-block;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: #1a73e8;
  text-decoration: none;
  transition: background 0.2s;
}

.side-tag-item:hover {
  background: #dce4ff;
  text-decoration: none;
}

/* サイドバーのカテゴリリスト */
.side-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.side-category-list li {
  margin-bottom: 6px;
}

.side-category-list a {
  text-decoration: none;
  color: #333;
}

.side-category-list a:hover {
  color: #1a73e8;
  text-decoration: underline;
}

/* サイドバーのリンクリスト */
.side-link-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 13px;
}

.side-link-list li {
  margin-bottom: 6px;
}

.side-link-list a {
  text-decoration: none;
  color: #333;
}

.side-link-list a:hover {
  color: #1a73e8;
  text-decoration: underline;
}

/* 編集ボタン */
.post-edit-controls {
  margin-bottom: 12px;
  text-align: right;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.edit-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 16px;
  border-radius: 6px;
  background: #1a73e8;
  color: #fff;
  font-size: 14px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
}

.edit-button:hover {
  background: #1558ad;
  text-decoration: none;
}

.edit-button-secondary {
  background: #6c757d;
}

.edit-button-secondary:hover {
  background: #5a6268;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
  .layout-main {
    flex-direction: column;
    gap: 16px;
  }

  .side-column {
    flex: none;
    order: 2;
  }

  .site-main {
    margin: 16px auto 40px;
    padding: 0 8px;
  }

  .post-article {
    padding: 16px 20px;
  }

  .site-header-inner {
    padding: 0 8px;
  }
}
/* 会話全体の枠 */
.chat-box {
  display: flex;
  width: 100%;
  margin-bottom: 20px;
  gap: 15px; /* アイコンとテキストの間隔 */
}

/* 左側のアイコンエリア */
.chat-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex-shrink: 0; /* 縮まないように固定 */
  width: 80px;    /* アイコンエリアの幅 */
}

.chat-face img {
  width: 60px;
  height: 60px;
  border-radius: 90%;
  object-fit: cover;
}

.chat-name {
  font-size: 12px;
  margin-top: 5px;
  font-weight: bold;
}

/* 右側のテキストエリア（吹き出し風） */
.chat-content {
  width: 100%;
}

.chat-text {
  /* ▼ ここで色変数を定義（デフォルト: gray） */
  --chat-bg: #eee;
  
  background-color: var(--chat-bg); /* 変数を使用 */
  padding: 15px;
  border-radius: 10px;
  position: relative;
  line-height: 1.6;
}

/* ▼ 色のバリエーション（変数を上書きするだけ） */
.chat-text.blue  { --chat-bg: #eef; }
.chat-text.green { --chat-bg: #efe; }
.chat-text.red   { --chat-bg: #fee; }

/* (オプション) 吹き出しのしっぽ */
.chat-text::after {
  content: "";
  position: absolute;
  top: 20px;
  left: -10px;
  border-top: 10px solid transparent;
  border-right: 10px solid var(--chat-bg);
  border-bottom: 10px solid transparent;
}

.chat-text p {
  margin: 0;
}