/*
 * tiny-bbs スタイルシート
 * 色やフォントは :root の変数を書き換えるだけで変更できます。
 */
:root {
  --bg: #f5f5e8;            /* ページ背景 */
  --text: #333333;          /* 文字色 */
  --link: #0000cc;
  --link-visited: #551a8b;
  --link-hover: #cc0000;
  --border: #999999;        /* 罫線 */
  --post-bg: #ffffff;       /* 記事の背景 */
  --reply-bg: #fbfbf3;      /* リンク先のレスの強調 */
  --title: #cc0000;         /* 題名 */
  --name: #006600;          /* 投稿者名 */
  --muted: #666666;
  --form-bg: #eeeedd;
  --error: #cc0000;
  --font: "MS PGothic", "ＭＳ Ｐゴシック", Osaka, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  --font-size: 15px;
  --width: 760px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 8px;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: var(--font-size);
  line-height: 1.6;
}

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

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

#container {
  max-width: var(--width);
  margin: 0 auto;
}

/* ヘッダー */
#header { text-align: center; }
#bbs-title { font-size: 1.5em; margin: 8px 0 4px; }
#bbs-title a { color: var(--text); text-decoration: none; }
#bbs-description { margin: 4px 0; }
#menu { font-size: 0.9em; }

#footer {
  text-align: center;
  font-size: 0.85em;
  color: var(--muted);
}

h2 {
  font-size: 1.05em;
  margin: 0 0 8px;
  padding: 2px 6px;
  border-left: 6px solid var(--title);
}

/* 投稿フォーム */
.form-box {
  background: var(--form-bg);
  border: 1px solid var(--border);
  padding: 10px;
}
.form-table { border-collapse: collapse; width: 100%; }
.form-table th {
  width: 6em;
  padding: 4px 8px 4px 0;
  text-align: right;
  vertical-align: top;
  font-weight: normal;
  white-space: nowrap;
}
.form-table td { padding: 4px 0; }
.form-table input[type="text"],
.form-table input[type="password"],
.form-table textarea {
  width: 100%;
  max-width: 32em;
  font: inherit;
}
.form-table textarea { max-width: 100%; }

.errors {
  color: var(--error);
  border: 1px solid var(--error);
  background: #fff0f0;
  padding: 4px 8px;
  margin-bottom: 8px;
}
.errors ul { margin: 0; padding-left: 1.2em; }
.notice { color: var(--muted); }
.warning { color: var(--error); font-weight: bold; }
.delete-actions form { margin: 8px 0; }
.empty { text-align: center; color: var(--muted); }

/* スレッド一覧 */
.thread-list {
  border-collapse: collapse;
  width: 100%;
  background: var(--post-bg);
}
.thread-list th,
.thread-list td {
  border: 1px solid var(--border);
  padding: 4px 6px;
}
.thread-list th { background: var(--form-bg); font-weight: normal; white-space: nowrap; }
.thread-list .tl-title { overflow-wrap: anywhere; }
.thread-list .tl-count { text-align: right; white-space: nowrap; width: 4em; }
.thread-list .tl-date { white-space: nowrap; font-size: 0.85em; color: var(--muted); width: 11em; }
.full { color: var(--error); font-size: 0.85em; }

/* スレッド (レス) */
.thread {
  background: var(--post-bg);
  border: 1px solid var(--border);
  padding: 8px 10px;
}
.thread-title { color: var(--title); }
.thread-title small { color: var(--muted); font-weight: normal; }
.res { margin: 0 0 12px; }
.res:target { background: var(--reply-bg); outline: 1px dashed var(--border); }
.res-head { font-size: 0.9em; }
.res-no { font-weight: bold; color: var(--text); text-decoration: none; }
.post-name { color: var(--name); font-weight: bold; }
.post-date { color: var(--muted); }
.res-body {
  margin: 4px 0 0 1.5em;
  overflow-wrap: anywhere;
}
.thread-nav { text-align: right; font-size: 0.9em; }
.sage { white-space: nowrap; font-size: 0.9em; }
.form-table input[type="text"]#f-name { width: auto; max-width: 100%; }
.hint { font-size: 0.85em; color: var(--muted); margin: 6px 0 0; }

/* ページ送り */
.pager { text-align: center; margin: 8px 0; }
.pager span { color: var(--muted); }

/* 管理画面 */
.message { text-align: center; }
.logout { text-align: right; margin-bottom: 8px; }
.table-wrap { overflow-x: auto; }
.admin-table {
  border-collapse: collapse;
  width: 100%;
  background: var(--post-bg);
  font-size: 0.9em;
}
.admin-table th,
.admin-table td {
  border: 1px solid var(--border);
  padding: 4px 6px;
  vertical-align: top;
}
.admin-table th { background: var(--form-bg); white-space: nowrap; }
.admin-table small { color: var(--muted); }

/* スマートフォン */
@media (max-width: 600px) {
  body { padding: 4px; }
  .form-table th,
  .form-table td { display: block; width: auto; text-align: left; padding: 2px 0; }
  .form-table input[type="text"],
  .form-table input[type="password"] { max-width: 100%; }
  .res-body { margin-left: 0.5em; }
  .thread-list .tl-date { display: none; }
}
