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

body {
  font-family: "MS PGothic", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 13px;
  background-color: #f0f0f0;
  color: #111;
  line-height: 1.5;
}

a {
  color: #0066cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
  color: #cc0000;
}

/* ===== ヘッダー ===== */
#header {
  background-color: #cc0000;
  color: #fff;
  padding: 8px 12px;
  border-bottom: 3px solid #990000;
}

#header h1 {
  font-size: 20px;
  font-weight: bold;
  letter-spacing: 2px;
}

#header h1 a {
  color: #fff;
  text-decoration: none;
}

#header .subtitle {
  font-size: 11px;
  color: #ffcccc;
  margin-top: 2px;
}

/* ===== ナビゲーション ===== */
#nav {
  background-color: #222;
  padding: 4px 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

#nav a {
  color: #ddd;
  font-size: 12px;
  padding: 3px 8px;
  border-right: 1px solid #555;
}

#nav a:hover {
  color: #ff9900;
  text-decoration: none;
  background-color: #333;
}

#nav a.active {
  color: #ff9900;
  background-color: #333;
}

/* ===== メインレイアウト ===== */
#wrapper {
  max-width: 1100px;
  margin: 0 auto;
  padding: 8px;
  display: flex;
  gap: 8px;
}

#main {
  flex: 1;
  min-width: 0;
}

#sidebar {
  width: 220px;
  flex-shrink: 0;
}

/* ===== カテゴリーボード一覧 ===== */
.board-section {
  background: #fff;
  border: 1px solid #ccc;
  margin-bottom: 8px;
}

.board-section-title {
  background: #336699;
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  padding: 5px 10px;
  border-bottom: 1px solid #225588;
}

.board-list {
  display: flex;
  flex-wrap: wrap;
  padding: 6px;
  gap: 4px;
}

.board-link {
  display: inline-block;
  background: #e8f0ff;
  border: 1px solid #aac;
  color: #0044aa;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 2px;
}

.board-link:hover {
  background: #336699;
  color: #fff;
  text-decoration: none;
  border-color: #225588;
}

/* ===== スレッド一覧 ===== */
.thread-list-header {
  background: #336699;
  color: #fff;
  padding: 6px 10px;
  font-weight: bold;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.thread-list-header .board-name {
  font-size: 15px;
}

.thread-list-controls {
  font-size: 11px;
  display: flex;
  gap: 8px;
}

.thread-list-controls button {
  background: #fff;
  color: #336699;
  border: 1px solid #aaa;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 11px;
  border-radius: 2px;
}

.thread-list-controls button:hover {
  background: #eee;
}

.thread-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border: 1px solid #ccc;
}

.thread-table thead tr {
  background: #ddeeff;
  border-bottom: 2px solid #99aacc;
}

.thread-table thead th {
  padding: 5px 8px;
  text-align: left;
  font-size: 12px;
  color: #333;
  font-weight: bold;
  white-space: nowrap;
}

.thread-table tbody tr {
  border-bottom: 1px solid #e0e0e0;
}

.thread-table tbody tr:hover {
  background-color: #ffffee;
}

.thread-table tbody tr:nth-child(even) {
  background-color: #f9f9f9;
}

.thread-table tbody tr:nth-child(even):hover {
  background-color: #ffffee;
}

.thread-table td {
  padding: 5px 8px;
  vertical-align: top;
}

.thread-num {
  width: 40px;
  text-align: center;
  color: #888;
  font-size: 12px;
  white-space: nowrap;
}

.thread-title a {
  color: #0044bb;
  font-size: 13px;
  font-weight: bold;
}

.thread-title a:hover {
  color: #cc0000;
}

.thread-title .thread-tag {
  display: inline-block;
  background: #cc0000;
  color: #fff;
  font-size: 10px;
  padding: 1px 4px;
  margin-right: 4px;
  border-radius: 2px;
  font-weight: normal;
  vertical-align: middle;
}

.thread-title .thread-tag.new {
  background: #009900;
}

.thread-res {
  width: 55px;
  text-align: center;
  color: #333;
  white-space: nowrap;
}

.thread-res .res-count {
  font-weight: bold;
  color: #cc0000;
}

.thread-date {
  width: 130px;
  color: #666;
  font-size: 11px;
  white-space: nowrap;
}

/* ===== スレッドページ ===== */
.thread-header {
  background: #fff;
  border: 1px solid #ccc;
  margin-bottom: 8px;
}

.thread-title-bar {
  background: #cc0000;
  color: #fff;
  padding: 8px 12px;
  font-size: 15px;
  font-weight: bold;
}

.thread-meta {
  padding: 6px 10px;
  font-size: 11px;
  color: #666;
  border-bottom: 1px solid #eee;
  display: flex;
  gap: 16px;
}

.thread-actions {
  padding: 6px 10px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.btn {
  background: #336699;
  color: #fff;
  border: none;
  padding: 4px 12px;
  cursor: pointer;
  font-size: 12px;
  border-radius: 2px;
  text-decoration: none;
  display: inline-block;
}

.btn:hover {
  background: #225588;
  color: #fff;
  text-decoration: none;
}

.btn-gray {
  background: #888;
}

.btn-gray:hover {
  background: #666;
}

/* ===== 投稿 ===== */
.post {
  background: #fff;
  border: 1px solid #ddd;
  margin-bottom: 4px;
}

.post-header {
  background: #eef0ff;
  padding: 4px 8px;
  font-size: 11px;
  color: #444;
  border-bottom: 1px solid #dde;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.post-num {
  font-weight: bold;
  color: #cc0000;
  font-size: 13px;
}

.post-name {
  color: #006600;
  font-weight: bold;
}

.post-id {
  color: #888;
  font-size: 10px;
}

.post-date {
  color: #666;
}

.post-body {
  padding: 8px 12px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-all;
}

.post-body .quote {
  color: #009900;
}

.post-body .anchor {
  color: #0066cc;
  cursor: pointer;
}

.post-body .anchor:hover {
  text-decoration: underline;
}

/* ===== 返信フォーム ===== */
.reply-form {
  background: #fff;
  border: 1px solid #ccc;
  margin-top: 8px;
}

.reply-form-title {
  background: #336699;
  color: #fff;
  padding: 5px 10px;
  font-weight: bold;
  font-size: 13px;
}

.reply-form-body {
  padding: 10px;
}

.reply-form-body table {
  width: 100%;
  border-collapse: collapse;
}

.reply-form-body td {
  padding: 4px 6px;
  vertical-align: middle;
}

.reply-form-body td:first-child {
  width: 80px;
  color: #444;
  font-weight: bold;
  white-space: nowrap;
  font-size: 12px;
}

.reply-form-body input[type="text"],
.reply-form-body textarea {
  width: 100%;
  border: 1px solid #aaa;
  padding: 4px 6px;
  font-size: 13px;
  font-family: inherit;
}

.reply-form-body textarea {
  height: 90px;
  resize: vertical;
}

.reply-form-body input[type="text"]:focus,
.reply-form-body textarea:focus {
  outline: 1px solid #336699;
  border-color: #336699;
}

.form-submit {
  margin-top: 8px;
  display: flex;
  gap: 8px;
  align-items: center;
}

.btn-post {
  background: #cc0000;
  color: #fff;
  border: none;
  padding: 6px 20px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 2px;
}

.btn-post:hover {
  background: #aa0000;
}

/* ===== サイドバー ===== */
.sidebar-box {
  background: #fff;
  border: 1px solid #ccc;
  margin-bottom: 8px;
}

.sidebar-box-title {
  background: #555;
  color: #fff;
  padding: 5px 10px;
  font-weight: bold;
  font-size: 12px;
}

.sidebar-box-body {
  padding: 8px;
}

.sidebar-thread-item {
  padding: 4px 0;
  border-bottom: 1px dotted #ddd;
  font-size: 12px;
}

.sidebar-thread-item:last-child {
  border-bottom: none;
}

.sidebar-thread-item a {
  color: #0044bb;
}

.sidebar-thread-item .count {
  color: #cc0000;
  font-weight: bold;
  font-size: 11px;
}

/* ===== パンくず ===== */
.breadcrumb {
  font-size: 12px;
  color: #666;
  padding: 5px 0;
  margin-bottom: 6px;
}

.breadcrumb a {
  color: #0066cc;
}

/* ===== ページネーション ===== */
.pagination {
  display: flex;
  gap: 4px;
  padding: 8px 0;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
}

.pagination span {
  color: #888;
}

.page-btn {
  display: inline-block;
  background: #fff;
  border: 1px solid #aaa;
  color: #0044bb;
  padding: 3px 8px;
  border-radius: 2px;
  font-size: 12px;
  cursor: pointer;
}

.page-btn:hover {
  background: #336699;
  color: #fff;
  text-decoration: none;
  border-color: #336699;
}

.page-btn.current {
  background: #cc0000;
  color: #fff;
  border-color: #cc0000;
  font-weight: bold;
}

/* ===== フッター ===== */
#footer {
  text-align: center;
  padding: 16px;
  font-size: 11px;
  color: #888;
  border-top: 1px solid #ccc;
  margin-top: 16px;
  background: #fff;
}

/* ===== 通知バナー ===== */
.notice-bar {
  background: #fffde7;
  border: 1px solid #f0c040;
  color: #555;
  font-size: 12px;
  padding: 5px 10px;
  margin-bottom: 6px;
}

/* ===== レスポンシブ ===== */
@media (max-width: 768px) {
  #wrapper {
    flex-direction: column;
    padding: 4px;
  }

  #sidebar {
    width: 100%;
  }

  .thread-date {
    display: none;
  }

  #nav {
    font-size: 11px;
  }
}
