@charset "UTF-8";

:root {
  --bg-main: #f7f7f7;
  --bg-card: #ffffff;
  --text-main: #2b2b2b;
  --text-sub: #666666;
  --border-color: #334155;
  --accent-color: #334155;
  --radius-lg: 14px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ページ全体の縦スクロールをなくす */
html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background-color: var(--bg-main);
  background-image: url('wall.png');
  background-repeat: repeat-x;
  background-size: auto 100vh;
  background-position: top left;
  background-attachment: fixed;
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

/* レイアウト全体：画面内に完全に収める */
.layout-container {
  display: flex;
  max-width: 1280px;
  height: 100vh;
  margin: 0 auto;
  padding: 24px;
  gap: 28px;
  box-sizing: border-box;
}

/* 左サイドバー：高さ固定せず自然な長さに */
.sidebar {
  width: 280px;
  flex-shrink: 0;
}

.sidebar-card {
  background: #334155;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  border: 1px solid rgba(0,0,0,0.2);
  color: #f8fafc;
}

.sidebar-card .profile-name {
  color: #ffffff;
}

.sidebar-card .profile-id,
.sidebar-card .profile-bio,
.sidebar-card .qr-label {
  color: #cbd5e1;
}

.profile-box {
  text-align: center;
}

.profile-icon {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto;
  display: block;
}

.profile-name {
  font-size: 1.15rem;
  font-weight: 700;
  margin-top: 6px;
  margin-bottom: -4px;
}

.profile-id {
  font-size: 0.8rem;
  margin-bottom: 10px;
}

.profile-bio {
  font-size: 0.85rem;
  white-space: pre-wrap;
  line-height: 1.5;
}

/* 外部リンクボタン */
.social-links {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}

.social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  font-size: 1rem;
  color: #334155;
  transition: background 0.2s, transform 0.15s;
}

.social-btn:hover {
  background: #ffffff;
  color: #0f172a;
  transform: translateY(-2px);
}

/* フリースペース：上下に区切り線（ボーダー）と余白を設定 */
.sidebar-free-space {
  margin-top: 16px;
  padding-top: 16px;
  margin-bottom: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 16px;
}

/* QRコードエリア */
.qr-box {
  margin-top: 16px;
  text-align: center;
}

.qr-thumb {
  display: inline-block;
  padding: 8px;
  background: #8B99AD;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
  overflow: hidden;
}

.qr-thumb canvas,
.qr-thumb img {
  display: block;
  border-radius: 0px;
  mix-blend-mode: multiply;
  opacity: 0.55; /* QRコードを薄くする */
  transition: opacity 0.2s;
}
.qr-thumb:hover {
  background: #fff;
}
.qr-thumb:hover img {
  opacity: 1;
}

.qr-label {
  display: block;
  font-size: 0.72rem;
  margin-top: 4px;
}

.admin-toggle-btn {
  width: 100%;
margin-top:15px;
  padding: 10px 14px;
  background: #2b384a;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-lg);
  font-size: 0.82rem;
  color: #7b8c9d;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
}

.admin-toggle-btn:hover {
  background: #334155;
  color: #cbd5e1;
}


/* メインエリア：画面の高さ（上下パディング分を引く）に収める */
.main-content {
  flex: 1;
  min-width: 0;
  height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
}

/* 掲示板コンテナ：全体をサイドバーと同じ #334155 の枠線と背景で完全に統一し、はみ出しをゼロにする */
.bbs-app-container {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: #334155;
  border-radius: var(--radius-lg, 14px);
  border: 1px solid #334155;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  overflow: hidden;
}

.bbs-header {
  padding: 14px 18px;
  background: transparent;
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.bbs-header-title {
  font-size: 1rem;
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #fff;
}

.bbs-header-title a {
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
}

.bbs-logo-img {
  max-height: 36px;
  width: auto;
  display: block;
}

.thread-select-link {
  font-size: 0.8rem;
  text-decoration: none;
  color: #cbd5e1;
  font-weight: normal;
}

.thread-select-link:hover {
  color: #fff;
}

.bbs-status {
 padding-left:10px;
  font-size: 0.75rem;
  color: #cbd5e1;
}

/* レス表示エリア（内部スクロール・スクロールバー非表示） */
.bbs-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  background: #ffffff;
  color: #2b2b2b;
  scrollbar-width: none;
}

.bbs-content::-webkit-scrollbar {
  display: none;
}

.bbs-content.select-mode {
  background: #f7f7f7;
}

.bbs-thread {
  background: transparent;
  border: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bbs-post {
  padding: 8px 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid #e5e7eb;
  font-size: 0.9rem;
  border-radius: 6px;
}

.bbs-post__meta {
  font-size: 0.85rem;
  margin-bottom: 2px;
  color: #6b7280;
  position: relative;
}

.bbs-post__name {
  color: #FE4D5E;
  cursor: pointer;
  font-weight: bold;
}

/* 自分の投稿の名前・本文を太字にする */
.bbs-post.my-post .bbs-post__name,
.bbs-post.my-post .bbs-post__body {
  font-weight: bold;
}

.bbs-post__name:hover {
  color: #B21423;
}

.bbs-post__body {
  line-height: 1.5;
  word-wrap: break-word;
}

.bbs-post__body a,
.bbs-post__anchor {
  color: #4b5563 !important;
  cursor: pointer;
}

.long-text-toggle {
  color: #6b7280;
  background: #f7f7f7;
  border: 1px dashed #d1d5db;
  padding: 4px 8px;
  border-radius: 4px;
  cursor: pointer;
  display: inline-block;
  font-size: 0.85rem;
}

/* YouTubeサムネイル（他PHPサイトと同様にコンパクトに制限） */
.yt-thumb-container {
  position: relative;
  display: inline-block;
  cursor: pointer;
  margin-top: 6px;
  border-radius: 6px;
  overflow: hidden;
  max-width: 240px;
  background: #000;
}
.yt-thumb-container img {
  display: block;
  width: 100%;
  height: auto;
}
.yt-play-btn {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 44px;
  height: 32px;
  background: rgba(0, 0, 0, 0.75);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.yt-play-btn::after {
  content: "";
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 6px 0 6px 11px;
  border-color: transparent transparent transparent #ffffff;
  margin-left: 2px;
}
.yt-thumb-container:hover .yt-play-btn {
  background: rgba(255, 0, 0, 0.9);
}

/* ポップアップおよびメニューのスタイル */
.popup-box {
  position: absolute;
  background: #fff;
  border: 1px solid #d1d5db;
  padding: 8px 12px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  font-size: 0.85rem;
  z-index: 1000;
  max-width: 320px;
  display: none;
}

.name-menu-popup {
  position: absolute;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
  z-index: 1001;
  font-size: 0.85rem;
  overflow: hidden;
}

.name-menu-item {
  padding: 8px 14px;
  cursor: pointer;
  color: #2b2b2b;
  white-space: nowrap;
}

.name-menu-item:hover {
  background: #f7f7f7;
}

.img-thumb {
  max-height: 80px;
  border-radius: 4px;
  cursor: pointer;
  margin-top: 4px;
  display: block;
}

.image-modal,
.youtube-modal,
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 2000;
}

.image-modal img {
  max-width: 90vw;
  max-height: 90vh;
}

.youtube-modal-content {
  position: relative;
  width: 90%;
  max-width: 720px;
  aspect-ratio: 16/9;
  background: #000;
}

.youtube-modal-content iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.youtube-modal-close {
  position: absolute;
  top: -40px;
  right: 0;
  color: #fff;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

.error-container {
  color: #334155;
  padding: 16px;
  text-align: center;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 8px;
}

.candidate-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.candidate-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: #f7f7f7;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  text-decoration: none;
  color: #334155;
  font-weight: bold;
}

/* 掲示板フッター（入力フォーム） */
.bbs-footer {
  padding: 12px 16px;
  background: #334155;
  border-top: 1px solid rgba(255,255,255,0.1);
  flex-shrink: 0;
}

.bbs-form__grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bbs-form__row-top {
  display: flex;
  gap: 6px;
  align-items: center;
}

.bbs-form__input {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #2b2b2b;
}

.bbs-form__clear {
  width: 70px;
  height: 38px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
}

.bbs-form__textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 14px;
  background: #ffffff;
  color: #2b2b2b;
  resize: none;
  height: 48px;
}

.bbs-form__submit {
  width: 100%;
  height: 38px;
  background: #64748b;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.bbs-form__submit:hover {
  background: #475569;
}

/* モーダル関連 */
.modal-box {
  background: #334155;
  color: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  font-size: 0.85rem;
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
  html, body {
    overflow: auto;
  }
  .layout-container {
    flex-direction: column;
    padding: 16px;
    height: auto;
  }
  .sidebar, .main-content {
    width: 100%;
    height: auto;
  }
  .bbs-app-container {
    height: 82vh;
  }
}


.sidebar-free-space p {
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  display: flex;
  justify-content: space-between;
  align-items: center;
}



