/* =====================================================================
   修道社 V5 - 公共創作プラットフォーム
   2000年代の超大型BBSポータル風（淡いベージュ×グレー・等幅・罫線）
   見た目はレトロ、内部はFlex/Gridの2026年基準レスポンシブ
   ===================================================================== */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: #efede3;            /* 淡いベージュ（ふたば・したらば系） */
  color: #3c3a33;
  font-family: "MS PGothic", "Hiragino Kaku Gothic ProN", Meiryo, Osaka, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  overflow-x: hidden;
}
a { color: #1a4a8a; }
a:visited { color: #5a4a7a; }
a:hover { color: #c33; }
img { max-width: 100%; height: auto; }
.mono { font-family: "Courier New", "Osaka-Mono", monospace; }

.wrap { max-width: 1100px; margin: 0 auto; padding: 0 8px 60px; }

/* ---------- サイトヘッダー（公共ポータルの顔） ---------- */
.site-top {
  background: #e4e1d3;
  border-bottom: 2px solid #a8a494;
  text-align: center; padding: 10px 8px 6px;
}
.site-top .logo {
  margin: 0; font-size: 28px; letter-spacing: .3em; font-weight: bold;
  color: #4a4435;
  text-shadow: 1px 1px 0 #fff;
  font-family: "Hiragino Mincho ProN", "Yu Mincho", serif;
}
.site-top .logo a { color: #4a4435; text-decoration: none; }
.site-top .sub { margin: 0; font-size: 11px; color: #7c7866; letter-spacing: .18em; }
.site-top .counter {
  display: inline-block; margin-top: 5px;
  background: #2e2c26; color: #8fd48f;
  font-family: "Courier New", monospace; font-size: 13px; letter-spacing: 3px;
  border: 2px inset #9a968a; padding: 1px 12px;
}
.site-top .counter small { color: #c8c4b4; letter-spacing: 0; font-size: 10px; }

/* 電光掲示板ティッカー */
.ticker {
  background: #2e2c26; color: #ffce54;
  overflow: hidden; white-space: nowrap; font-size: 13px;
  border-bottom: 1px solid #555;
}
.ticker span {
  display: inline-block; padding: 3px 0; padding-left: 100%;
  animation: tick 26s linear infinite;
}
@keyframes tick { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }
.blink { animation: blink 1s step-start infinite; color: #c33; font-weight: bold; }
@keyframes blink { 50% { opacity: 0; } }

/* 板ナビ（タブ風・スマホは横スクロール） */
.board-nav {
  display: flex; flex-wrap: nowrap; gap: 0; overflow-x: auto; -webkit-overflow-scrolling: touch;
  background: #dcd9c8; border-bottom: 2px solid #a8a494; padding: 0 4px;
}
.board-nav a {
  flex-shrink: 0; text-decoration: none; color: #4a4435;
  font-size: 12.5px; padding: 7px 12px; border-right: 1px solid #c2beac;
  white-space: nowrap;
}
.board-nav a:first-child { border-left: 1px solid #c2beac; }
.board-nav a:hover { background: #efede3; color: #c33; }
.board-nav a.active { background: #efede3; font-weight: bold; }
.board-nav a.nav-post { background: #8a3324; color: #fff; font-weight: bold; }
.board-nav a.nav-post:hover { background: #6e2418; color: #fff; }
.login-line {
  text-align: right; font-size: 11.5px; color: #7c7866;
  background: #e9e6d8; padding: 3px 10px; border-bottom: 1px solid #c8c4b4;
}

/* ---------- 見出しバー（昔の管理ツール風） ---------- */
.bar {
  background: linear-gradient(180deg, #c9c5b2, #b4b09c);
  border: 1px solid #8f8b7a; border-top-color: #e6e3d5; border-left-color: #e6e3d5;
  color: #38352b; font-weight: bold; font-size: 14px;
  padding: 5px 12px; margin: 22px 0 8px;
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px;
  text-shadow: 1px 1px 0 rgba(255,255,255,.5);
}
.bar .more { font-size: 11.5px; font-weight: normal; }
.bar.red { background: linear-gradient(180deg, #c98f86, #b07065); color: #3a1610; border-color: #8a5a50; }

/* ---------- パネル ---------- */
.panel {
  background: #faf9f4; border: 1px solid #b4b09c;
  padding: 12px 14px; margin-bottom: 12px;
}
.panel.dotted { border-style: dashed; background: #f5f4ec; }

/* ---------- 2カラムポータル ---------- */
.portal { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
@media (max-width: 860px) { .portal { grid-template-columns: 1fr; } }

/* ---------- サムネイルの絨毯グリッド ---------- */
/* ---------- サムネイルギャラリー（お絵かきBBS風） ---------- */
/* ---------- サムネイルギャラリー（正方形カード） ---------- */
.thumb-grid{
  display:grid;
  gap:12px;
  grid-template-columns:repeat(auto-fill,minmax(132px,1fr));
}

.thumb-card{
  background:#fff;
  border:1px solid #e8b9c4;
  border-radius:4px;
  box-shadow:2px 2px 0 #f6dde4;
  text-decoration:none;
  color:inherit;
  display:flex;
  flex-direction:column;
  overflow:hidden;
}

.thumb-card:hover{
  background:#fff6f8;
  text-decoration:none;
  box-shadow:2px 2px 0 #eab4c2;
}

.thumb-card .frame{
  position:relative;
  width:100%;
  aspect-ratio:1 / 1;
  overflow:hidden;
  border-bottom:1px solid #f0c6d1;
  background:#fdf3f5;
}

.thumb-card .frame img{
  width:100%;
  height:100%;
  object-fit:contain;
  object-position:center center;
  display:block;
}

.t-badge{
  position:absolute;
  left:0;
  top:0;
  color:#fff;
  font-size:10px;
  padding:1px 7px;
  border-bottom-right-radius:6px;
  opacity:.95;
}

.t-bgm{
  position:absolute;
  right:2px;
  bottom:2px;
  background:rgba(124,40,64,.8);
  color:#ffe3ad;
  font-size:10px;
  padding:0 6px;
  border-radius:8px;
}

.t-new{
  position:absolute;
  right:2px;
  top:2px;
  background:#e23a5d;
  color:#fff;
  font-size:9px;
  font-weight:bold;
  padding:1px 5px;
  border-radius:8px;
}

.thumb-card .t-title{
  display:block;
  padding:6px;
  font-size:12px;
  font-weight:bold;
  color:#6b4450;
  line-height:1.3;
  word-break:break-word;
}

.thumb-card .t-author{
  padding:0 6px 6px;
  font-size:11px;
  color:#ad7d8a;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}

/* スマホ3列 */
@media (max-width:700px){

  .thumb-grid{
    grid-template-columns:repeat(3,1fr);
    gap:8px;
  }

}

/* ---------- スレッド一覧（昔のスレ一覧テーブル） ---------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.list { width: 100%; border-collapse: collapse; background: #faf9f4; font-size: 13px; }
table.list th, table.list td { border: 1px solid #b4b09c; padding: 5px 8px; text-align: left; vertical-align: top; }
table.list th { background: #dcd9c8; color: #4a4435; white-space: nowrap; font-size: 12px; }
table.list tr:nth-child(even) td { background: #f3f1e8; }
.res-count { font-family: "Courier New", monospace; color: #8a3324; font-weight: bold; }
.momentum { font-size: 11px; color: #8a8676; }

/* リスト型（新着など） */
.line-list { background: #faf9f4; border: 1px solid #b4b09c; font-size: 12.5px; }
.line-list .row { padding: 5px 9px; border-bottom: 1px dotted #c8c4b4; display: flex; gap: 6px; align-items: baseline; flex-wrap: wrap; }
.line-list .row:last-child { border-bottom: none; }
.line-list .time { font-family: "Courier New", monospace; font-size: 11px; color: #9a968a; flex-shrink: 0; }
.line-list .row b { font-weight: bold; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-block; cursor: pointer; text-decoration: none;
  background: #e9e6d8; border: 1px solid #8f8b7a; border-radius: 0;
  color: #3c3a33; font-family: inherit; font-size: 13.5px;
  padding: 10px 20px; min-height: 42px; line-height: 1.4;
  -webkit-appearance: none; appearance: none;
}
.btn:hover { background: #f5f4ec; color: #c33; text-decoration: none; }
.btn:active { background: #dcd9c8; }
.btn.primary { background: #8a3324; border-color: #5e1f14; color: #fff; font-weight: bold; }
.btn.primary:hover { background: #6e2418; color: #fff; }
.btn.small { font-size: 12px; padding: 5px 12px; min-height: 32px; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

/* 拍手ボタン */
.clap-btn {
  display: inline-flex; align-items: center; gap: 7px; cursor: pointer;
  background: #fff; border: 2px solid #8a3324; color: #8a3324;
  font-size: 15px; font-weight: bold; padding: 10px 26px;
  -webkit-appearance: none; appearance: none;
}
.clap-btn:hover { background: #fbeeea; }
.clap-btn:active { transform: scale(.97); }
.clap-btn .cnt { font-family: "Courier New", monospace; }

/* ---------- フォーム ---------- */
.form-table { width: 100%; border-collapse: collapse; }
.form-table th {
  width: 150px; text-align: left; vertical-align: top;
  background: transparent; border: none; border-bottom: 1px solid #b4b09c;
  color: #4a4435; font-size: 12.5px; font-weight: bold; padding: 13px 8px 5px 0;
}
.form-table td { border: none; border-bottom: 1px solid #ddd9c8; padding: 9px 0 15px; }
input[type=text], input[type=password], select, textarea {
  width: 100%; max-width: 100%;
  background: #fff; border: 1px solid #9a968a; border-radius: 0;
  color: #3c3a33; font-family: inherit; font-size: 15px; padding: 10px 11px;
  -webkit-appearance: none; appearance: none;
}
select { padding-right: 28px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23777'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; }
textarea { min-height: 120px; resize: vertical; }
input[type=file] { font-size: 13px; width: 100%; padding: 6px 0; }
input:focus, select:focus, textarea:focus { outline: none; border-color: #4a4435; box-shadow: 0 0 0 2px rgba(74,68,53,.12); }
.note { font-size: 11.5px; color: #8a8676; margin-top: 5px; line-height: 1.6; }
.checks { display: flex; flex-direction: column; }
label.check { display: flex; align-items: center; gap: 8px; padding: 8px 0; font-size: 13.5px; border-bottom: 1px dotted #ddd9c8; cursor: pointer; }
label.check:last-child { border-bottom: none; }
label.check input { width: 18px; height: 18px; flex-shrink: 0; margin: 0; accent-color: #8a3324; }
.error-box { background: #f3e4e0; border-left: 4px solid #8a3324; color: #5e1f14; font-size: 13.5px; padding: 9px 13px; margin: 10px 0; }
.ok-box { background: #e9efe2; border-left: 4px solid #6a8a4a; color: #3a4a2a; font-size: 13.5px; padding: 9px 13px; margin: 10px 0; }

/* ---------- レス（2ch型ログ・ID表示） ---------- */
.res-list { font-size: 13.5px; }
.res-item { padding: 9px 4px; border-bottom: 1px dotted #b4b09c; }
.res-item:target { background: #fdf3d8; }
.res-head { font-size: 12px; color: #6a675c; }
.res-head .no { font-weight: bold; color: #8a3324; }
.res-name { color: #1a7a2a; font-weight: bold; font-size: 13px; }
.trip { color: #1a7a2a; font-size: 12px; font-family: "Courier New", monospace; }
.res-id { font-family: "Courier New", monospace; color: #9a968a; font-size: 11px; }
.res-body { margin: 3px 0 0 6px; word-break: break-word; }
.anchor { color: #1a4a8a; text-decoration: underline; cursor: pointer; }
.spoiler { background: #3c3a33; color: #3c3a33; padding: 0 4px; cursor: pointer; }
.spoiler.revealed, .spoiler:hover { color: #fff; }
.filled-box {
  background: #3c3a33; color: #efede3; text-align: center;
  font-size: 13px; padding: 10px; margin: 10px 0;
}

/* アンカーポップアップ */
#anchor-pop {
  position: absolute; z-index: 200; max-width: 480px;
  background: #fdfdf8; border: 2px solid #4a4435; box-shadow: 3px 3px 0 rgba(0,0,0,.25);
  font-size: 12.5px; padding: 8px 11px; line-height: 1.6;
}
#anchor-pop .res-head { margin-bottom: 2px; }

/* ---------- 音源リスト ---------- */
.media-list { display: grid; gap: 9px; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.media-item { background: #faf9f4; border: 1px solid #b4b09c; padding: 10px 12px; }
.media-item .m-title { font-weight: bold; color: #38352b; font-size: 13.5px; }
.kind-tag {
  display: inline-block; font-size: 10.5px; color: #fff; padding: 0 7px; margin-right: 5px;
}
.kind-bgm { background: #4a6a8a; }
.kind-se { background: #6a8a4a; }
.kind-voice { background: #8a5a8a; }
.tag-mini { display: inline-block; background: #efede3; border: 1px solid #c8c4b4; color: #6a675c; font-size: 11px; padding: 0 7px; margin: 0 3px 3px 0; }
audio { width: 100%; height: 32px; }
.muted { color: #8a8676; font-size: 12px; }

/* ---------- 作品ビューア ---------- */
.viewer-v { max-width: 760px; margin: 0 auto; }
.viewer-v .page-block { position: relative; margin-bottom: 4px; }
.viewer-v img { display: block; width: 100%; border: 1px solid #b4b09c; background: #fff; }
.page-fx {
  position: absolute; left: 0; bottom: 0; background: rgba(46,44,38,.78); color: #efede3;
  font-size: 10.5px; padding: 2px 8px; font-family: "Courier New", monospace;
}
.viewer-h { text-align: center; }
.viewer-h img { max-width: 100%; max-height: 76vh; cursor: pointer; border: 1px solid #b4b09c; background: #fff; }
.page-controls { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }

#sndbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 90;
  background: #2e2c26; color: #d8d4c4; border-top: 2px solid #8a3324;
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; font-size: 12.5px;
}
#sndbar .btn { flex-shrink: 0; min-height: 38px; padding: 7px 14px; background: #efede3; }
#sndbar .info { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-family: "Courier New", monospace; }
.eq { color: #8fd48f; letter-spacing: -1px; font-family: monospace; }

/* ---------- タイムライン編集 ---------- */
.tl-row {
  display: grid; grid-template-columns: 90px 1fr; gap: 10px;
  background: #faf9f4; border: 1px solid #b4b09c; padding: 8px; margin-bottom: 8px;
  align-items: start;
}
.tl-row .pg img { width: 100%; border: 1px solid #c8c4b4; }
.tl-row .pg .num { text-align: center; font-family: "Courier New", monospace; font-size: 11px; color: #6a675c; }
.tl-row .sel-grid { display: grid; gap: 6px; }
.tl-row label { font-size: 11.5px; color: #4a4435; font-weight: bold; }

/* ---------- マイページ ---------- */
.author-head {
  display: flex; gap: 13px; align-items: center; flex-wrap: wrap;
  background: #faf9f4; border: 2px solid #8f8b7a; padding: 13px 15px;
}
.author-avatar {
  width: 54px; height: 54px; flex-shrink: 0;
  background: #dcd9c8; border: 1px solid #9a968a; color: #4a4435;
  display: flex; align-items: center; justify-content: center; font-size: 24px; font-weight: bold;
}
.author-head .pen { font-size: 17px; font-weight: bold; color: #38352b; }
.author-head .attrs { font-size: 12px; color: #8a8676; }
.stat-row { display: flex; gap: 0; flex-wrap: wrap; border: 1px solid #b4b09c; background: #faf9f4; }
.stat { flex: 1; min-width: 90px; text-align: center; padding: 8px 4px; border-right: 1px solid #ddd9c8; }
.stat:last-child { border-right: none; }
.stat b { display: block; font-size: 18px; font-family: "Courier New", monospace; color: #8a3324; }
.stat span { font-size: 11px; color: #8a8676; }

/* ---------- フッター ---------- */
.site-footer {
  border-top: 2px solid #a8a494; background: #e4e1d3;
  color: #7c7866; font-size: 11.5px; text-align: center; padding: 16px 10px 22px; margin-top: 40px;
}
.site-footer a { color: #5a564a; }
.empty-note {
  background: #faf9f4; border: 2px dashed #b4b09c;
  color: #8a8676; padding: 24px 12px; text-align: center; font-size: 13px;
}
.center { text-align: center; }

/* 互換 */
.section-head {
  background: linear-gradient(180deg, #c9c5b2, #b4b09c);
  border: 1px solid #8f8b7a; color: #38352b; padding: 5px 12px; margin: 22px 0 8px;
  display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 4px;
}
.section-head h2 { margin: 0; font-size: 14px; color: #38352b; }
.section-head .more { font-size: 11.5px; }
.card { background: #faf9f4; border: 1px solid #b4b09c; padding: 12px 14px; margin-bottom: 12px; }
.admin-red { color: #8a3324; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 700px) {
  body { font-size: 13.5px; }
  .site-top .logo { font-size: 22px; letter-spacing: .2em; }
  .thumb-grid { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
  .form-table, .form-table tbody, .form-table tr, .form-table th, .form-table td { display: block; width: 100%; }
  .form-table th { padding: 11px 0 3px; border-bottom: none; }
  .form-table td { padding: 0 0 16px; }
  table.list { font-size: 12px; }
  .tl-row { grid-template-columns: 72px 1fr; }
  #anchor-pop { max-width: 86vw; }
}

/* あぼーん（削除済みレス） */
.res-item.res-aborn { opacity: .55; }
.res-item.res-aborn .res-body { font-style: italic; }
