@charset "UTF-8";

/* ============================================================
   有識者ちゃんねる - 2000年代の巨大掲示板の見た目を再現する
   read.cgi 時代のカラー / フォント / 余白を基準にしている
   ============================================================ */

:root {
  --color-bg: #efefef;
  --color-text: #000000;
  --color-link: #0000ff;
  --color-link-visited: #660099;
  --color-link-hover: #ff0000;
  --color-name: #008000;
  --color-title: #ff0000;
  --color-meta: #000000;
  --color-rule: #999999;
  --color-popup-bg: #ffffee;

  /* AA は MS Pゴシック系のプロポーショナル幅を前提に描かれている */
  --font-base: "IPAMonaPGothic", "Mona", "MS PGothic", "ＭＳ Ｐゴシック",
    "MotoyaLCedar", Osaka, sans-serif;
}

html {
  background-color: var(--color-bg);
}

body {
  margin: 8px;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-base);
  font-size: 13px;
  line-height: 1.35;
  word-break: break-all;
}

a {
  color: var(--color-link);
  text-decoration: underline;
}

a:visited {
  color: var(--color-link-visited);
}

a:hover,
a:active {
  color: var(--color-link-hover);
}

hr {
  border: 0;
  border-top: 1px solid var(--color-rule);
  margin: 8px 0;
}

/* ---------- 共通ヘッダ / フッタ ---------- */

.site-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: bold;
  color: var(--color-title);
  text-align: center;
}

.site-title a,
.site-title a:visited {
  color: inherit;
  text-decoration: none;
}

.site-tagline {
  margin: 0 0 12px;
  font-size: 12px;
  text-align: center;
}

.board-title {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: bold;
  color: var(--color-title);
  text-align: center;
}

.local-rule {
  margin: 0 0 10px;
  font-size: 12px;
  text-align: center;
}

.nav {
  margin: 6px 0;
  font-size: 12px;
}

.nav .sep {
  color: var(--color-rule);
  margin: 0 2px;
}

.nav .current {
  color: var(--color-text);
  font-weight: bold;
  text-decoration: none;
}

.footer {
  margin-top: 16px;
  padding-top: 6px;
  border-top: 1px solid var(--color-rule);
  font-size: 11px;
  color: #444444;
  text-align: center;
}

.footer .cgi-version {
  font-family: "Courier New", monospace;
}

/* ---------- トップページ（板一覧） ---------- */

.welcome {
  margin: 0 auto 16px;
  padding: 8px 10px;
  max-width: 720px;
  border: 1px solid var(--color-rule);
  background-color: #ffffff;
  font-size: 12px;
}

.welcome p {
  margin: 0 0 4px;
}

.welcome ul {
  margin: 0;
  padding-left: 1.4em;
}

.category {
  margin: 0 0 14px;
}

.category-name {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: bold;
  border-bottom: 1px solid var(--color-rule);
}

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

.board-list li {
  margin: 2px 0;
}

.board-list .count {
  color: #555555;
  font-size: 11px;
}

.board-list .desc {
  color: #555555;
  font-size: 11px;
}

/* ---------- 板ページ（スレッド一覧） ---------- */

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

.subject-list li {
  margin: 1px 0;
}

.subject-list .index {
  color: var(--color-text);
}

.subject-list .count {
  color: #555555;
}

.subject-list .full {
  color: var(--color-title);
}

.empty-notice {
  margin: 10px 0;
  font-size: 12px;
}

/* ---------- スレッドページ ---------- */

.thread-title {
  margin: 8px 0;
  font-size: 20px;
  font-weight: bold;
  color: var(--color-text);
}

.thread-url {
  margin: 0 0 8px;
  font-size: 11px;
  color: #555555;
  font-family: "Courier New", monospace;
}

.filter-notice {
  margin: 6px 0;
  padding: 4px 6px;
  border: 1px solid var(--color-rule);
  background-color: #ffffdd;
  font-size: 12px;
}

.posts {
  margin: 8px 0;
}

.post {
  margin: 0 0 1.1em;
}

.post dt {
  margin: 0;
  font-weight: normal;
}

.post dd {
  margin: 0.2em 0 0 1em;
  /* AA の空白と改行をそのまま表示する */
  white-space: pre-wrap;
  font-size: 14px;
  line-height: 1.45;
}

.post .resno {
  color: var(--color-link);
  cursor: pointer;
}

.post .name {
  color: var(--color-name);
  font-weight: bold;
}

.post .name-mail {
  font-weight: bold;
}

.post .trip {
  font-weight: bold;
}

.post .meta {
  color: var(--color-meta);
}

.post .uid {
  cursor: pointer;
}

.post.is-target dd {
  background-color: #ffffcc;
}

/* ---------- 添付画像（当時のうｐろだ＋専用ブラウザのサムネ表示） ---------- */

.attach {
  /* 親の dd が pre-wrap なので、ここだけ通常の折り返しに戻す */
  white-space: normal;
  margin: 0.4em 0 0;
}

.attach-head {
  font-size: 12px;
  color: #333333;
}

.attach-info {
  color: #555555;
  margin-left: 4px;
}

.attach-link {
  display: inline-block;
  margin-top: 3px;
  padding: 2px;
  border: 1px solid var(--color-rule);
  background-color: #ffffff;
  line-height: 0;
}

.attach-link:hover {
  border-color: var(--color-link-hover);
}

.attach-thumb {
  display: block;
  width: 240px;
  max-width: 100%;
  height: auto;
  background-color: #000000;
}

/* 動画ファイルと YouTube 埋め込み。サムネより一回り大きく取る */
.attach-video {
  display: block;
  box-sizing: border-box;
  width: 360px;
  max-width: 100%;
  margin-top: 3px;
  border: 1px solid var(--color-rule);
  background-color: #000000;
}

.attach-embed {
  position: relative;
  box-sizing: border-box;
  width: 480px;
  max-width: 100%;
  margin-top: 3px;
  border: 1px solid var(--color-rule);
  background-color: #000000;
}

.attach-embed::before {
  content: "";
  display: block;
  padding-top: 56.25%; /* 16:9 */
}

.attach-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* 外部サイトの画像・動画は、押したときだけ読み込む */
.attach-reveal {
  display: block;
  margin-top: 3px;
  padding: 4px 8px;
  border: 1px dashed var(--color-rule);
  background-color: #ffffff;
  color: var(--color-link);
  font-family: var(--font-base);
  font-size: 12px;
  cursor: pointer;
}

.attach-reveal:hover {
  color: var(--color-link-hover);
  border-color: var(--color-link-hover);
}

/* 端末内に保存したファイルが見つからないとき（別の端末・データ削除後） */
.attach-missing {
  display: none;
  font-size: 12px;
  color: #777777;
}

.attach.is-missing .attach-missing {
  display: block;
}

.attach.is-missing .attach-link,
.attach.is-missing .attach-video {
  display: none;
}

/* 削除されたレス（あぼーん） */
.post.is-deleted dt,
.post.is-deleted dd {
  color: #888888;
}

/* レスごとの通報リンク。目立たせすぎず、探せば分かる程度に */
.post .report-link,
.post .report-link:visited {
  margin-left: 4px;
  font-size: 11px;
  color: #888888;
  text-decoration: none;
}

.post .report-link:hover {
  color: var(--color-link-hover);
  text-decoration: underline;
}

.res-popup .popup-attach {
  white-space: normal;
  margin-top: 2px;
  font-size: 12px;
  color: #333333;
}

.post-1001 {
  margin: 12px 0;
  color: var(--color-title);
  font-size: 13px;
  white-space: pre-wrap;
}

/* レスアンカーのポップアップ（専用ブラウザ風） */
.res-popup {
  position: absolute;
  z-index: 100;
  max-width: 560px;
  padding: 4px 6px;
  border: 1px solid #666666;
  background-color: var(--color-popup-bg);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  font-size: 13px;
  white-space: pre-wrap;
}

.res-popup .popup-head {
  white-space: normal;
  margin-bottom: 2px;
}

/* ---------- 書き込みフォーム ---------- */

.write-form {
  margin: 14px 0 8px;
  padding: 8px;
  border: 1px solid var(--color-rule);
  background-color: #ffffff;
}

.write-form .form-title {
  margin: 0 0 6px;
  font-weight: bold;
  font-size: 13px;
}

.write-form .field {
  margin: 0 0 4px;
  font-size: 12px;
}

.write-form label {
  margin-right: 4px;
}

.write-form input[type="text"] {
  font-family: var(--font-base);
  font-size: 13px;
  padding: 1px 2px;
}

.write-form input.name-input {
  width: 170px;
}

.write-form input.mail-input {
  width: 170px;
}

.write-form input.image-input {
  width: 380px;
  max-width: 80%;
}

.write-form input.file-input {
  font-family: var(--font-base);
  font-size: 12px;
  max-width: 100%;
}

.write-form button:disabled {
  color: #888888;
}

.write-form input.title-input {
  width: 420px;
  max-width: 90%;
}

.write-form textarea {
  display: block;
  width: 96%;
  max-width: 640px;
  font-family: var(--font-base);
  font-size: 14px;
  line-height: 1.45;
}

.write-form button {
  font-family: var(--font-base);
  font-size: 13px;
  padding: 2px 12px;
  margin-top: 4px;
}

.write-form .hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: #555555;
}

.form-error {
  margin: 4px 0;
  color: var(--color-title);
  font-size: 12px;
  font-weight: bold;
}

.form-error:empty {
  display: none;
}

.storage-warning {
  margin: 6px 0;
  padding: 4px 6px;
  border: 1px solid var(--color-title);
  background-color: #fff0f0;
  font-size: 12px;
}

/* ---------- トップページの補足 ---------- */

.new-mark {
  margin-left: 4px;
  padding: 0 3px;
  font-size: 10px;
  font-weight: bold;
  color: #ffffff;
  background-color: var(--color-title);
  vertical-align: 1px;
}

.welcome .welcome-report {
  margin: 6px 0 0;
  font-weight: bold;
}

/* ---------- 通報窓口 ---------- */

.report-form select {
  font-family: var(--font-base);
  font-size: 13px;
  max-width: 100%;
}

.report-form select.thread-select {
  width: 420px;
}

.report-form input.no-input {
  width: 80px;
  font-family: var(--font-base);
  font-size: 13px;
}

.report-preview {
  margin: 6px 0 8px;
  padding: 4px 6px;
  border: 1px dashed var(--color-rule);
  background-color: var(--color-popup-bg);
  font-size: 12px;
}

.report-preview.is-empty {
  color: #777777;
}

.report-preview-body {
  white-space: pre-wrap;
  margin-top: 2px;
}

.reason-list {
  margin: 6px 0;
  padding: 4px 8px;
  border: 1px solid var(--color-rule);
}

.reason-list legend {
  padding: 0 4px;
}

.reason-item {
  display: inline-block;
  margin: 2px 14px 2px 0;
}

.report-receipt {
  margin: 8px 0;
  padding: 6px 8px;
  border: 1px solid var(--color-name);
  background-color: #f0fff0;
  font-size: 13px;
}

.report-receipt p {
  margin: 2px 0;
}

.report-history-wrap {
  overflow-x: auto;
}

.report-history {
  border-collapse: collapse;
  margin: 4px 0 12px;
  font-size: 12px;
  background-color: #ffffff;
}

.report-history th,
.report-history td {
  padding: 3px 6px;
  border: 1px solid var(--color-rule);
  text-align: left;
  vertical-align: top;
}

.report-history th {
  background-color: #e0e0e0;
  white-space: nowrap;
}

/* ============================================================
   スマートフォン向けの調整

   配色・フォント・レイアウトの構造は当時のままにして、
   幅・余白・タップ領域だけを画面サイズに合わせる。
   ダークテーマは用意していない。read.cgi 時代の
   薄いグレー地に青リンクという配色そのものが再現の対象なので、
   反転させると別物になってしまうため。
   ============================================================ */

@media (max-width: 640px) {
  body {
    margin: 6px;
  }

  .site-title {
    font-size: 18px;
  }

  .board-title {
    font-size: 15px;
  }

  .thread-title {
    font-size: 17px;
  }

  .thread-url {
    font-size: 10px;
  }

  /* 板一覧・スレ一覧・ナビは指で押せる高さを確保する */
  .board-list li,
  .subject-list li,
  .nav {
    line-height: 2;
  }

  /* レス番号＋名前で1行、日時＋IDで1行。専用ブラウザのスマホ表示に近い形 */
  .post dt {
    font-size: 12px;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  .post .meta {
    display: block;
  }

  .post dd {
    margin-left: 0.4em;
    font-size: 12px;
    /* AA は途中で折らず、URL のような切れ目のない文字列だけ折る */
    word-break: normal;
    overflow-wrap: break-word;
    overflow-x: auto;
  }

  .post .resno {
    padding: 0 3px;
  }

  .attach-thumb {
    width: 300px;
  }

  .res-popup {
    max-width: calc(100vw - 24px);
    font-size: 12px;
  }

  /* フォームは1項目1行にして、入力欄を画面幅いっぱいに広げる */
  .write-form label {
    display: block;
    margin: 5px 0 1px;
  }

  .write-form input[type="text"],
  .write-form textarea {
    display: block;
    box-sizing: border-box;
    width: 100%;
  }

  .write-form input.name-input,
  .write-form input.mail-input,
  .write-form input.title-input,
  .write-form input.image-input {
    width: 100%;
    max-width: none;
  }

  .write-form textarea {
    max-width: none;
  }

  .report-form select,
  .report-form select.thread-select {
    display: block;
    box-sizing: border-box;
    width: 100%;
  }

  .reason-item {
    display: block;
    line-height: 1.9;
  }

  .attach-video,
  .attach-embed {
    width: 100%;
  }

  .write-form button {
    padding: 6px 18px;
  }

  .welcome {
    padding: 6px 8px;
  }
}

/* ---------- 単体テストページ（開発用） ---------- */

.test-summary {
  font-size: 14px;
  font-weight: bold;
  margin: 8px 0;
}

.test-list {
  margin: 0;
  padding-left: 1.4em;
  font-size: 12px;
}

.test-pass {
  color: #006600;
}

.test-fail {
  color: #cc0000;
  font-weight: bold;
}
