/* 2ch クラシックスタイル */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: #EEEEEE;
  font-family: "MS Pゴシック", "MS PGothic", "ヒラギノ角ゴ Pro", Osaka, monospace;
  font-size: 12px;
  color: #000000;
  line-height: 1.4;
}

/* ヘッダー */
#header {
  background-color: #AAAAFF;
  border-bottom: 2px solid #0000AA;
  padding: 6px 8px;
}

#site-name {
  font-size: 11px;
  color: #0000AA;
  text-decoration: underline;
  cursor: pointer;
  margin-bottom: 2px;
}

#board-title {
  font-size: 16px;
  font-weight: bold;
  color: #000080;
  margin-bottom: 4px;
}

#board-info {
  font-size: 11px;
  color: #330000;
  background-color: #DDDDFF;
  border: 1px solid #9999CC;
  padding: 3px 6px;
  margin-top: 4px;
}

/* スレッド情報バー */
#thread-info {
  background-color: #BBBBEE;
  border-bottom: 1px solid #9999CC;
  padding: 4px 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
}

#thread-title {
  font-weight: bold;
  color: #000080;
}

#post-count {
  color: #444;
}

/* 書き込みフォーム */
#post-form-wrap {
  background-color: #F4F4FF;
  border: 1px solid #AAAACC;
  margin: 6px 8px;
  padding: 4px;
}

#post-form {
  width: 100%;
  border-collapse: collapse;
}

#post-form td {
  vertical-align: middle;
}

.form-label {
  font-weight: bold;
  color: #000080;
  white-space: nowrap;
  padding-right: 6px;
  width: 36px;
}

#post-form input[type="text"] {
  font-family: inherit;
  font-size: 12px;
  border: 1px inset #999;
  padding: 2px 4px;
  width: 180px;
  background: #FFFFFF;
}

#input-content {
  font-family: inherit;
  font-size: 12px;
  border: 1px inset #999;
  padding: 4px;
  width: 100%;
  min-width: 400px;
  background: #FFFFFF;
  resize: vertical;
}

#submit-row {
  padding-top: 4px;
}

#submit-btn {
  font-family: inherit;
  font-size: 12px;
  background-color: #CCCCDD;
  border: 2px outset #AAAACC;
  padding: 3px 14px;
  cursor: pointer;
  font-weight: bold;
  color: #000080;
}

#submit-btn:hover {
  background-color: #AAAAEE;
}

#submit-btn:active {
  border-style: inset;
}

#submit-btn:disabled {
  background-color: #DDDDDD;
  color: #888;
  cursor: not-allowed;
}

#reset-btn {
  font-family: inherit;
  font-size: 11px;
  background-color: #DDCCCC;
  border: 2px outset #CCAAAA;
  padding: 2px 10px;
  cursor: pointer;
  color: #660000;
  margin-left: 8px;
}

#reset-btn:hover {
  background-color: #EECCCC;
}

#loading-msg {
  color: #CC0000;
  font-weight: bold;
  animation: blink 1s step-end infinite;
}

@keyframes blink {
  50% { opacity: 0; }
}

/* セクション区切り */
.section-hr {
  border: none;
  border-top: 2px solid #9999CC;
  margin: 0 8px;
}

/* 投稿エリア */
#posts-container {
  padding: 6px 8px;
}

#empty-msg {
  text-align: center;
  color: #666;
  padding: 20px;
  font-style: italic;
}

/* 1件の投稿 */
.post {
  margin-bottom: 8px;
  border: 1px solid #CCCCCC;
  background-color: #FFFFFF;
}

.post.op-post {
  border-color: #9999CC;
}

.post.ai-post {
  border-color: #BBCCBB;
}

/* 投稿ヘッダー */
.post-header {
  background-color: #EEEEFF;
  border-bottom: 1px solid #CCCCEE;
  padding: 3px 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.post.op-post .post-header {
  background-color: #DDDDFF;
}

.post.ai-post .post-header {
  background-color: #E8F0E8;
  border-bottom-color: #AACCAA;
}

.post-no {
  font-weight: bold;
  color: #000080;
  cursor: pointer;
  white-space: nowrap;
}

.post-no:hover {
  text-decoration: underline;
}

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

.post-date {
  color: #555;
  font-size: 11px;
}

.post-uid {
  color: #888;
  font-size: 11px;
  font-family: monospace;
}

.post-uid::before {
  content: "ID:";
}

.ai-badge {
  background-color: #AACCAA;
  color: #004400;
  font-size: 10px;
  padding: 0 4px;
  border: 1px solid #88AA88;
  border-radius: 2px;
  white-space: nowrap;
}

/* 投稿本文 */
.post-body {
  padding: 6px 10px 8px;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.6;
  font-size: 12px;
}

.post.sage-post .post-name {
  color: #446644;
}

/* フッター */
#footer {
  text-align: center;
  padding: 8px;
  color: #0000AA;
  font-size: 11px;
  border-top: 1px solid #9999CC;
  margin-top: 4px;
}

#footer-info {
  color: #888;
  font-size: 10px;
}

/* 新着投稿のハイライトアニメーション */
@keyframes newpost {
  from { background-color: #FFFFCC; }
  to   { background-color: transparent; }
}

.post.new {
  animation: newpost 2s ease-out forwards;
}

/* エラーメッセージ */
.error-msg {
  background-color: #FFEEEE;
  border: 1px solid #CC0000;
  color: #CC0000;
  padding: 6px 10px;
  margin: 6px 8px;
  font-weight: bold;
}

/* スマホ対応 */
@media (max-width: 600px) {
  body {
    font-size: 14px;
  }

  #board-title {
    font-size: 14px;
  }

  #thread-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  /* テーブルをブロック表示に切り替えて縦並びに */
  #post-form,
  #post-form tbody,
  #post-form tr,
  #post-form td {
    display: block;
    width: 100%;
  }

  .form-label {
    width: auto;
    padding: 6px 0 2px;
  }

  /* iOSでタップ時に自動ズームさせないためfont-size:16px */
  #post-form input[type="text"] {
    width: 100%;
    font-size: 16px;
    padding: 6px 4px;
    box-sizing: border-box;
  }

  #input-content {
    min-width: 0;
    width: 100%;
    font-size: 16px;
    padding: 6px;
    box-sizing: border-box;
  }

  #submit-btn {
    font-size: 16px;
    padding: 10px 24px;
  }

  #reset-btn {
    font-size: 14px;
    padding: 8px 16px;
  }

  .post-body {
    font-size: 14px;
  }

  .post-date {
    font-size: 10px;
  }
}
