/* ベーススタイル */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "MS PGothic", "Monomakh", "Segoe UI", sans-serif;
  background-color: #f0eef0;
  color: #333;
  line-height: 1.6;
  padding: 20px;
}

header {
  text-align: center;
  margin-bottom: 20px;
  background-color: #333;
  color: #fff;
  padding: 10px;
  border-radius: 4px;
}

.container {
  max-width: 1000px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.card {
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 4px;
  padding: 15px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* メインコンテンツレイアウト */
.main-content {
  display: flex;
  gap: 20px;
}

@media (max-width: 768px) {
  .main-content {
    flex-direction: column;
  }
}

/* サイドバー：スレッド一覧 */
.thread-list-container {
  flex: 1;
  min-width: 250px;
}

.thread-list-container h2 {
  font-size: 1.1rem;
  margin-bottom: 10px;
  border-bottom: 2px solid #000080;
  padding-bottom: 5px;
}

#btn-refresh-threads {
  width: 100%;
  padding: 5px;
  margin-bottom: 10px;
  cursor: pointer;
}

#thread-list {
  list-style: none;
  max-height: 400px;
  overflow-y: auto;
}

#thread-list li {
  padding: 8px;
  border-bottom: 1px dashed #ccc;
  cursor: pointer;
  font-size: 0.9rem;
}

#thread-list li:hover {
  background-color: #e6f2ff;
  color: #0000cc;
}

#thread-list li.active {
  background-color: #cce6ff;
  font-weight: bold;
}

/* メイン表示エリア */
.thread-view-container {
  flex: 2.5;
  display: flex;
  flex-direction: column;
}

#thread-header {
  border-bottom: 2px solid #000080;
  padding-bottom: 10px;
  margin-bottom: 15px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

#current-thread-title {
  font-size: 1.2rem;
  color: #000080;
}

#posts-container {
  max-height: 500px;
  overflow-y: auto;
  padding-right: 10px;
  margin-bottom: 20px;
}

.placeholder-text {
  color: #777;
  font-style: italic;
  text-align: center;
  margin-top: 30px;
}

/* 投稿（レス）スタイル */
.post {
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #eee;
}

.post-header {
  font-size: 0.85rem;
  color: #555;
  margin-bottom: 5px;
}

.post-num {
  font-weight: bold;
  color: #0000cc;
}

.post-author {
  color: #008000;
  font-weight: bold;
}

.post-date {
  color: #666;
}

.post-id {
  color: #888;
}

.post-body {
  font-size: 0.95rem;
  white-space: pre-wrap;
  word-break: break-all;
}

/* アンカーリンク */
.anchor-link {
  color: #0000cc;
  text-decoration: underline;
  cursor: pointer;
}

.anchor-link:hover {
  color: #ff0000;
}

/* フォーム */
#create-thread-form, #reply-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

input[type="text"], textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 3px;
  font-size: 0.9rem;
}

textarea {
  resize: vertical;
  min-height: 80px;
}

button {
  background-color: #e1e1e1;
  border: 1px solid #999;
  padding: 8px 15px;
  cursor: pointer;
  border-radius: 3px;
  font-weight: bold;
}

button:hover {
  background-color: #d1d1d1;
}

.hidden {
  display: none !important;
}

/* ポップアップ（アンカープレビュー） */
.popup {
  position: absolute;
  background-color: #ffffcc;
  border: 1px solid #333;
  padding: 10px;
  box-shadow: 2px 2px 5px rgba(0,0,0,0.2);
  z-index: 1000;
  max-width: 400px;
  font-size: 0.85rem;
}