/* 掲示板ページの背景 */
/* iOS Safari対応: background-attachment: fixed を削除（グラデーションなので影響は軽微） */
body {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    min-height: 100vh;
    padding: 20px 0;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}


/* 掲示板全体のコンテナ */
.board-container, .create-thread-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background: rgba(240, 244, 248, 0.95);  /* 背景色を少し透過 */
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    color: #2d3748;  /* ダークグレー系のテキスト */
}

/* 掲示板のタイトル */
.board-title {
    background: #e2e8f0;  /* 薄いグレー */
    padding: 12px;
    border-left: 5px solid #4a5568;  /* ダークグレー */
    margin-bottom: 15px;
    color: #2d3748;
}

/* スレッド番号のスタイル（控えめ） */
.thread-id-small {
    color: #666666;
    font-size: 0.8em;
    margin-right: 10px;
    opacity: 0.8;
}

/* スレッドバッジ */
.thread-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75em;
    margin-left: 8px;
    vertical-align: middle;
}

.badge-restricted {
    background-color: #dc3545;
    color: white;
}

.badge-password {
    background-color: #ffc107;
    color: #212529;
}

/* 掲示板一覧 */
.board-list {
    margin: 10px 0;
}

.board-item {
    border-bottom: 1px solid #ddd;
    padding: 12px;
    background: #f9f9f9;
}

.board-item:hover {
    background: #f0f0f0;
}

/* スレッド一覧 */
.thread-list {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.thread-item {
    display: block;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #ddd;
    padding: 12px;
    background: #f9f9f9;
    transition: background-color 0.2s ease;
}

.thread-item:hover {
    background: #f0f0f0;
    text-decoration: none;
}

.thread-item:last-child {
    border-bottom: none;
}

.thread-title {
    font-size: 1.1em;
    color: #2c5282;
    margin-bottom: 5px;
}

.thread-info {
    font-size: 0.9em;
    color: #666;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.thread-info span {
    white-space: nowrap;
}

/* レス関連 */
.post-list {
    margin: 15px 0;
    background: #ffffff;  /* 白背景に変更 */
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post-item {
    background: transparent;
    padding: 8px 16px;
    margin-bottom: 2px;
    border: none;
    background-color: #fff;
    display: flex;
    flex-direction: column;
}

.post-item:hover {
    background: #f8f9fa;  /* 薄いグレーに変更 */
}

.post-header {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    padding: 4px 0;
    margin-bottom: 4px;
    width: 100%;
}

.post-number {
    color: #6c757d;
    font-size: 0.8em;
    min-width: 2.5em;
}

.post-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
}

.post-user-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #e2e8f0;
}

.post-name {
    color: #2c5282;  /* 濃い青に変更 */
    font-weight: 500;
}

.post-date {
    margin-left: 8px;
    color: #6c757d;  /* グレーに変更 */
    font-size: 0.75em;
}

/* 投稿内容のスタイル */
.post-content {
    color: #212529;
    padding: 0 0 0 24px;  /* アイコンの横幅分ずらす */
    margin-top: -4px;
    /* フォントファミリーの優先順位を調整 */
    font-family: 'MS PGothic', 'ＭＳ Ｐゴシック', 'Mona', 'IPA モナー Pゴシック', 'IPAMonaPGothic', 'MS Gothic', 'Osaka-等幅', monospace;
    /*white-space: pre-wrap;  /* 改行を防ぎ、横スクロールを有効にする */
    line-height: 1.1;  /* AAに適した行間 */
    -webkit-text-size-adjust: none;  /* スマホでの自動文字サイズ調整を無効化 */
    text-size-adjust: none;  /* 全ブラウザ対応 */
    letter-spacing: 0;  /* 文字間隔を固定 */
    font-display: swap;
    font-size: 16px;
    /* 長い文字列の折り返し対応 */
    word-break: break-all;
    overflow-wrap: break-word;
    max-width: 100%;
}

@media screen and (max-width: 480px) {
    .post-content {
        font-size: 12px;
    }
}


/* 新着投稿のスタイル */
.new-post .post-content {
    text-indent: 0;  /* インデントをリセット */
    padding-left: 24px;  /* パディングを明示的に指定 */
}



/* AAフォントの設定 */
@font-face {
  font-family: "saitamaar_light";
  src: url("/static/fonts/saitamaar_light.woff2") format("woff2"),
       url("/static/fonts/saitamaar_light.woff") format("woff"),
       url("/static/fonts/saitamaar_light.ttf") format("ttf");
  font-display: swap;
}

/* AA表示用のスタイル */
.aa-content {
    font-size: 12px;
    white-space: pre;
    overflow-x: auto;
    font-family: "saitamaar_light", monospace;
    line-height: 1.2;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* 投稿フォーム */
.post-form, .create-thread-form {
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.post-form h3 {
    color: #2d3748;
    margin-bottom: 16px;
}

.post-form textarea {
    background: #ffffff;
    border: 1px solid #e9ecef;
    color: #212529;
    resize: vertical;
}

.post-form textarea:focus {
    background: #ffffff;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-text {
    color: #6c757d;
}

/* 文字数カウンター */
#charCount {
    font-weight: 600;
    color: #2d3748;
}

#charCount.over-limit {
    color: #e53e3e;  /* 制限超過時は赤色 */
}

.post-form button {
    background: #4CAF50;
    color: white;
    padding: 8px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
}

.post-form button:hover {
    background: #45a049;
}

/* スレッド作成フォーム */
.thread-form {
    margin-top: 10px;
}

.thread-form .input-group {
    display: flex;
    gap: 10px;
}

.thread-form input[type="text"] {
    flex-grow: 1;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.thread-form button {
    white-space: nowrap;
}

/* レスアンカー */
.res-anchor {
    color: #4a90e2;  /* 青色に変更 */
    text-decoration: none;
}

.res-anchor:hover {
    text-decoration: underline;
}

/* 引用 */
.quote {
    color: #789922;
    padding-left: 10px;
    border-left: 2px solid #789922;
    margin: 5px 0;
}

/* スレッド管理ボタン */
.thread-controls {
    margin-left: 1rem;
}

.thread-controls .btn {
    margin-left: 0.5rem;
}

/* 削除確認モーダル */
.modal-body .text-danger {
    margin-top: 1rem;
    font-size: 0.9em;
}

/* ボタン */
.btn-primary {
    background-color: #4299e1;
    border-color: #3182ce;
}

.btn-primary:hover {
    background-color: #3182ce;
    border-color: #2c5282;
}

.btn-secondary {
    background-color: #718096;
    border-color: #4a5568;
}

.btn-secondary:hover {
    background-color: #4a5568;
    border-color: #2d3748;
}

/* モーダル */
.modal-content {
    background: #f0f4f8;
}

.modal-header {
    background: #edf2f7;
    border-bottom: 1px solid #e2e8f0;
}

.modal-footer {
    background: #edf2f7;
    border-top: 1px solid #e2e8f0;
}

/* スレッド作成フォーム */
.create-thread-container {
    max-width: 800px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 5px;
}

.create-thread-form {
    background: #fff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.create-thread-form .form-label {
    font-weight: bold;
    color: #333;
}

.create-thread-form .form-control:focus {
    border-color: #4CAF50;
    box-shadow: 0 0 0 0.2rem rgba(76, 175, 80, 0.25);
}

.create-thread-form .btn-group {
    margin-top: 15px;
}

.create-thread-form .alert-danger {
    margin-bottom: 15px;
    padding: 10px 15px;
    border-radius: 4px;
}

/* スレッド作成の情報表示 */
.thread-creation-info {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-end;
}

.thread-creation-info .alert {
    font-size: 0.85rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    background-color: #ebf8ff;
    border: 1px solid #bee3f8;
    color: #2c5282;
}

.thread-creation-info .alert i {
    margin-right: 0.5rem;
}

/* スレッド作成の要件バッジ */
.requirement-badge {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.7rem;
    white-space: nowrap;
    background: #ebf8ff;
    color: #2c5282;
    padding: 2px 8px;
    border-radius: 3px;
    border: 1px solid #bee3f8;
    margin-top: 4px;
}

.requirement-badge i {
    font-size: 0.7rem;
    margin-right: 3px;
}

/* フローティングボタン共通スタイル */
.floating-button-group {
    position: fixed;
    right: 12px;  /* さらに余白を縮小 */
    bottom: 12px;  /* さらに余白を縮小 */
    display: flex;
    flex-direction: column;
    gap: 10px;  /* ボタン間の間隔をさらに縮小 */
    z-index: 1000;
}

.floating-button-item {
    display: flex;
    justify-content: center;
}

.btn-floating {
    width: 32px;  /* さらにサイズを小さく */
    height: 32px;  /* さらにサイズを小さく */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);  /* シャドウも少し控えめに */
    transition: all 0.3s ease;
    background-color: white;
    border: 1.5px solid;  /* ボーダーも少し細く */
    padding: 0;
    cursor: pointer;
}

.btn-floating i {
    font-size: 0.9rem;  /* アイコンサイズをさらに小さく */
}

/* お気に入りボタン */
.btn-floating.favorite-btn {
    border-color: #ffc107;
}

.btn-floating.favorite-btn i {
    color: #ffc107;
}

.btn-floating.favorite-btn:hover {
    background-color: #fff9e6;
}

.btn-floating.favorite-btn.active {
    background-color: #ffc107;
}

.btn-floating.favorite-btn.active i {
    color: white;
}

/* 戻るボタン */
.btn-floating.back-btn {
    border-color: #4299e1;
    background-color: #4299e1;  /* 背景を水色に */
}

.btn-floating.back-btn i {
    color: white;  /* アイコンを白に */
}

.btn-floating.back-btn:hover {
    background-color: #3182ce;  /* ホバー時は少し濃い色に */
    border-color: #3182ce;
    transform: scale(1.1);
}

/* スクロールボタン */
.btn-floating.scroll-button {
    border-color: #4299e1;
    background-color: #4299e1;  /* 背景を水色に */
}

.btn-floating.scroll-button i {
    color: white;  /* アイコンを白に */
}

.btn-floating.scroll-button:hover {
    background-color: #3182ce;  /* ホバー時は少し濃い色に */
    border-color: #3182ce;
    transform: scale(1.1);
}

/* スレッド作成者情報 */
.thread-user-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.thread-user-info img.post-user-icon {
    width: 24px;  /* スレッド一覧では少し小さめに */
    height: 24px;
}

.thread-user-info span {
    color: #2c5282;
    font-weight: 500;
}

/* 投稿画像（複数枚を横並び） */
.post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.post-images .post-image {
    flex: 1 1 120px;
    max-width: 300px;
}

.post-image {
    max-width: 100%;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post-image img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* サムネイル画像表示 */
.post-image .thumbnail-container {
    cursor: pointer;
    display: inline-block;
    margin: 10px 0;
}

.post-image .thumbnail {
    max-width: 300px;
    height: auto;
    border-radius: 4px;
    image-orientation: from-image;  /* EXIFデータに基づいて向きを自動調整 */
    -webkit-image-orientation: from-image;
}

/* 画像モーダル */
.image-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 1050;
    overflow: hidden;
}

.image-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-fullsize {
    width: auto;
    max-width: 90vw;
    max-height: 90vh;
    margin: 1rem;
    min-width: 200px;  /* 小さい画像の最小幅を設定 */
}

.image-modal .modal-content {
    background: transparent;
    border: none;
    display: flex;
    flex-direction: column;
    max-height: 90vh;
}

.image-modal .modal-header {
    background: transparent;
    border: none;
    padding: 0.5rem;
    z-index: 1;
}

.image-modal .modal-body {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.image-modal .modal-image {
    max-width: max(100%, 200px);  /* 100%と200pxの大きい方を採用 */
    max-height: calc(90vh - 4rem);  /* ヘッダーの高さを考慮 */
    object-fit: contain;
    margin: auto;
}

.image-modal .btn-close {
    background-color: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    padding: 0.5rem;
    margin: 0.5rem;
    transition: background-color 0.2s;
}

.image-modal .btn-close:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

/* 画像の遅延ロード */
.post-image img.loading {
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

.post-image img.loaded {
    opacity: 1;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .post-image .thumbnail {
        max-width: 200px;
        max-height: 200px;
    }

    .modal-fullsize {
        max-width: 95vw;
        margin: 0.5rem;
    }

    .image-modal .modal-image {
        max-height: calc(95vh - 3rem);
        min-width: 200px;  /* スマートフォン表示でも最小幅を維持 */
    }
}

/* 画像アップロードとプレビュー */
.image-upload-container {
    position: relative;
    margin-bottom: 10px;
}

.image-preview {
    position: relative;
    margin-top: 10px;
    max-width: 200px;
}

.preview-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.remove-preview {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #e53e3e;
    color: white;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s;
}

.remove-preview:hover {
    background: #c53030;
}

/* スレッド詳細 */
.thread-description {
    background: #f8f9fa;
    padding: 15px;
    margin: 15px 0;
    border-radius: 6px;
    border-left: 4px solid #4a90e2;
    color: #2d3748;
    line-height: 1.6;
}

/* スレッド作成フォーム */
.create-thread-form textarea {
    min-height: 100px;
    background: #ffffff;
    border: 1px solid #e9ecef;
    color: #212529;
}

.create-thread-form textarea:focus {
    background: #ffffff;
    border-color: #4a90e2;
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

/* 投稿なしメッセージ */
.no-posts-message {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 10px 0;
}

.no-posts-message i {
    font-size: 2em;
    margin-bottom: 10px;
    color: #4a90e2;
}

.no-posts-message p {
    margin: 0;
    font-size: 1.1em;
}

/* ボード説明 */
.board-section {
    margin-bottom: 30px;
}

.board-header {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px 6px 0 0;
    border-bottom: 2px solid #4a90e2;
}

.board-name {
    color: #2c5282;
    font-size: 1.25em;
    margin: 0 0 8px 0;
}

.board-description {
    color: #4a5568;
    font-size: 0.95em;
    line-height: 1.5;
    padding: 8px 0 0 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

.thread-list {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* ボード情報 */
.board-info {
    background: #edf2f7;
    padding: 12px 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    border-left: 4px solid #4a90e2;
}

.board-header-compact {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* スマホ・タブレットでは上下二段配置 */
@media (max-width: 768px) {
    .board-header-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

.board-name {
    color: #2c5282;
    font-size: 1.2em;
    margin: 0;
    white-space: nowrap;
}

.board-description {
    color: #4a5568;
    font-size: 0.9em;
    line-height: 1.4;
    margin: 0;
    flex: 1;
}

/* スマホ・タブレットでのボード名と説明の調整 */
@media (max-width: 768px) {
    .board-name {
        white-space: normal;  /* 改行を許可 */
        word-break: break-word;  /* 長い単語の改行を許可 */
    }
    
    .board-description {
        width: 100%;  /* 全幅を使用 */
        word-break: break-word;  /* 長い単語の改行を許可 */
        hyphens: auto;  /* 自動ハイフネーション */
    }
}

/* ユーザーアイコンとリンク */
.user-icon-link {
    display: inline-block;
    transition: transform 0.2s;
}

.user-icon-link:hover {
    transform: scale(1.1);
}

.user-name-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.user-name-link:hover {
    color: #4a90e2;
    text-decoration: underline;
}

.user-icon-link:hover .post-user-icon {
    border-color: #4a90e2;
}

/* 新着投稿のハイライト */
@keyframes highlightPost {
    0% {
        background-color: rgba(255, 152, 0, 0.15);  /* オレンジ色に変更 */
    }
    100% {
        background-color: transparent;
    }
}

.post-item.new-post {
    animation: highlightPost 30s ease-out forwards;
    border-left: 3px solid #ff9800;  /* 左端にオレンジのボーダーを追加 */
    padding-left: 13px;  /* ボーダーの分だけパディングを調整 */
}

/* ユーザーアイコンボタン */
.user-icon-form {
    margin: 0;
    padding: 0;
}

.icon-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: transform 0.2s;
}

.icon-button:hover {
    transform: scale(1.1);
}

.icon-button:focus {
    outline: none;
}

.icon-button img.post-user-icon {
    margin: 0;
}

/* スレッド作成者アイコン */
.thread-creator {
    display: flex;
    align-items: center;
    gap: 4px;
}

.thread-creator .user-icon-form {
    display: inline-flex;
    align-items: center;
}

.thread-creator .icon-button {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #2c5282;
    font-weight: 500;
}

.thread-creator .post-user-icon.small-icon {
    width: 24px;
    height: 24px;
    margin: 0 0 0 4px;
}

.thread-creator .icon-button:hover {
    transform: scale(1.05);
}

.thread-creator .icon-button:hover span {
    text-decoration: underline;
}

/* ナビゲーションボタン */
.navigation-buttons {
    margin-top: 10px;
    display: flex;
    gap: 10px;
}

.navigation-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.navigation-buttons .btn i {
    font-size: 0.9em;
}

/* 掲示板注意事項 */
.board-notice {
    background: #fff3e0;  /* 薄いオレンジ色の背景 */
    border: 1px solid #ffe0b2;
    border-left: 4px solid #ff9800;
    border-radius: 6px;
    padding: 15px 20px;
    margin-bottom: 20px;
}

.board-notice h3 {
    color: #e65100;
    font-size: 1.1em;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.board-notice h3 i {
    color: #ff9800;
}

.board-notice ul {
    margin: 0;
    padding-left: 20px;
}

.board-notice li {
    color: #424242;
    margin-bottom: 5px;
    line-height: 1.4;
    font-size: 0.95em;
}

.board-notice li:last-child {
    margin-bottom: 0;
}

/* レスポップアップ */
.res-popup {
    position: absolute;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    z-index: 1000;
    display: none;
    pointer-events: none;  /* ポップアップ上でのマウスイベントを無効化 */
}

.res-popup.show {
    display: block;
}

.res-popup .post-item {
    padding: 0;
    margin: 0;
    background: transparent;
}

.res-popup .post-content {
    padding-left: 0;
}

/* 画面分割ボタン */
.btn-group .btn-outline-secondary {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 8px;
    font-size: 0.875rem;
}

.btn-group .btn-outline-secondary i {
    font-size: 0.9em;
}

.btn-group .btn-outline-secondary:hover {
    background-color: #4a5568;
    color: white;
}

.thread-creator-post {
    background-color: #f8f9fa;
}

@keyframes newPostHighlightNormal {
    0% {
        background-color: rgba(255, 243, 224, 1);  /* 薄いオレンジ色 */
        border-left: 3px solid #ff9800;
    }
    100% {
        background-color: #fff;
        border-left: none;
    }
}

@keyframes newPostHighlightCreator {
    0% {
        background-color: rgba(230, 241, 255, 1);  /* 薄い青色 */
        border-left: 3px solid #007bff;  /* 新着時のみ青いバー */
    }
    100% {
        background-color: #f8f9fa;
        border-left: none;  /* アニメーション終了後はバーを消す */
    }
}

.new-post {
    animation: newPostHighlightNormal 30s ease-out forwards;
}

.thread-creator-post.new-post {
    animation: newPostHighlightCreator 30s ease-out forwards;
}

/* お気に入りスレッドサイドバー */
.favorite-threads-sidebar {
    position: fixed;
    left: -400px;
    top: 0;
    width: 400px;
    height:100vh;
    background-color: #f8f9fa;
    padding: 15px;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    transition: left 0.3s ease;
    z-index: 1000;
    overflow-y: auto;
}

.favorite-threads-sidebar.open {
    left: 0;
}

/* トリガーボタン */
.favorite-trigger {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #4299e1;
    color: white;
    border: none;
    border-radius: 0 8px 8px 0;
    padding: 15px 12px;
    cursor: pointer;
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
    z-index: 1001;
    transition: left 0.3s ease;
    width: 40px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.favorite-trigger.open {
    left: 400px;
}

.favorite-trigger:hover {
    background: #3182ce;
}

/* サイドバーヘッダー */
.favorite-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e2e8f0;
}

.favorite-close {
    background: none;
    border: none;
    color: #718096;
    cursor: pointer;
    padding: 5px;
}

.favorite-close:hover {
    color: #4a5568;
}

/* スクロール可能なコンテンツエリア */
.favorite-content {
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding-right: 5px;
}

@media (max-width: 768px) {
    .favorite-threads-sidebar {
        width: 100%;
        left: -100%;
        top: 0;
        transition: left 0.3s ease;
    }
    
    .favorite-threads-sidebar.open {
        left: 0;
    }

    .favorite-trigger {
        left: 0;
        top: 20px;
        transform: none;
    }

    .favorite-trigger.open {
        left: 0;  /* スマホ表示時はボタンは移動しない */
    }
}

.favorite-thread-item {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
}

.favorite-thread-info {
    display: flex;
    gap: 15px;
    margin-top: 4px;
    font-size: 0.8rem;
    color: #6c757d;
}

.favorite-thread-info i {
    margin-right: 4px;
    font-size: 0.8em;
}

.favorite-thread-info .post-count {
    color: #4a5568;
}

.favorite-thread-info .last-post {
    color: #718096;
}

/* スレッドバッジ */
.thread-badge {
    font-size: 0.75rem;
    padding: 0.25em 0.6em;
    border-radius: 10px;
    margin-left: 0.5rem;
    display: inline-block;
    vertical-align: middle;
}

.badge-new {
    background-color: #ff6b6b;
    color: white;
    animation: pulse 2s infinite;
}

.badge-read {
    background-color: #51cf66;
    color: white;
}

.badge-unread {
    background-color: #868e96;
    color: white;
}

.badge-restricted {
    background-color: #e74c3c;
    color: white;
    border: 1px solid #c0392b;
}

.badge-restricted i {
    font-size: 0.7rem;
    margin-right: 2px;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 1;
    }
}

/* スレッドの勢い表示 */
.thread-momentum {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85em;
    padding: 2px 6px;
    border-radius: 12px;
    background-color: #f0f0f0;
    color: #666;
}

.thread-momentum.high {
    background-color: #ffebee;
    color: #c62828;
}

.thread-momentum.medium {
    background-color: #fff3e0;
    color: #ef6c00;
}

.thread-momentum.low {
    background-color: #f1f8e9;
    color: #558b2f;
}

.thread-momentum i {
    font-size: 0.9em;
}

/* ページネーション */
.pagination {
    margin: 20px 0;
}

.pagination .page-link {
    color: #4299e1;
    border-color: #e2e8f0;
    padding: 0.5rem 0.75rem;
}

.pagination .page-item.active .page-link {
    background-color: #4299e1;
    border-color: #4299e1;
    color: white;
}

.pagination .page-link:hover {
    background-color: #ebf8ff;
    border-color: #bee3f8;
    color: #2b6cb0;
}

.pagination .page-item.disabled .page-link {
    color: #a0aec0;
    background-color: #f7fafc;
    border-color: #e2e8f0;
}

/* ページ情報 */
.page-info {
    text-align: center;
    color: #718096;
    font-size: 0.9em;
    margin-top: 10px;
}

/* AAモードトグル */
.aa-mode-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.aa-mode-toggle input[type="checkbox"] {
    cursor: pointer;
}

/* AAモードでの投稿表示 */
.post-content.aa-mode {
    font-size: 12px;
    white-space: pre;
    overflow-x: auto;
    font-family: "saitamaar_light", monospace;
    line-height: 1.2;
    background: #fff;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

@media screen and (max-width: 480px) {
    .post-content.aa-mode {
        font-size: 9px;
    }
}


/* スクロールバーのカスタマイズ */
.post-content.aa-mode::-webkit-scrollbar {
    height: 8px;
}

.post-content.aa-mode::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.post-content.aa-mode::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

/* 投稿番号ボタン */
.post-number-btn {
    color: #6c757d;
    font-size: 0.8em;
    min-width: 2.5em;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    margin-left: auto;
}

.post-number-btn:hover {
    background-color: #f0f2f5;
    color: #4a90e2;
}

/* 検索フォーム */
.search-form {
    margin-bottom: 20px;
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.search-form .input-group {
    max-width: 600px;
    margin: 0 auto;
}

.search-form input[type="search"] {
    border-right: none;
    border-color: #e2e8f0;
}

.search-form input[type="search"]:focus {
    box-shadow: none;
    border-color: #4299e1;
}

.search-form .btn-search {
    background-color: #4299e1;
    color: white;
    border-color: #4299e1;
}

.search-form .btn-search:hover {
    background-color: #3182ce;
    border-color: #3182ce;
}

/* 検索結果表示 */
.search-results {
    margin-bottom: 15px;
    padding: 10px 15px;
    background: #ebf8ff;
    border-radius: 6px;
    color: #2c5282;
}

.search-results .clear-search {
    color: #4a5568;
    text-decoration: none;
    margin-left: 10px;
}

.search-results .clear-search:hover {
    color: #2d3748;
    text-decoration: underline;
}

/* リアクションボタン */
.post-reactions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 8px;
    padding-left: 24px;
}

.reaction-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
}

.reaction-btn:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.reaction-btn.active {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

.reaction-btn .emoji {
    font-size: 1.1em;
}

.reaction-btn .reaction-count {
    color: #4a5568;
    font-size: 0.9em;
}

.add-reaction-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px dashed #cbd5e0;
    border-radius: 12px;
    background: transparent;
    color: #718096;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.add-reaction-btn:hover {
    background: #edf2f7;
    border-color: #a0aec0;
    color: #4a5568;
}

.add-reaction-btn i {
    font-size: 0.8em;
}

/* リアクションモーダル */
.reaction-modal {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-width: 400px;
    width: 90%;
}

.reaction-modal.show {
    display: block;
}

.reaction-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-top: 10px;
}

.reaction-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1.2em;
}

.reaction-option:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.reaction-option.selected {
    background: #e2e8f0;
    border-color: #cbd5e0;
}

/* 草スタンプ専用スタイル */
.reaction-option.grass-stamp {
    color: #16a34a;
    font-weight: bold;
}

/* 投稿内の草リアクション表示 */
.reaction-btn.grass-reaction .emoji {
    color: #16a34a;
    font-weight: bold;
}

/* Doneスタンプ専用スタイル */
.reaction-option.done-stamp {
    color: #17a2b8;
    font-weight: bold;
    letter-spacing: -0.5px;
    font-size: 0.9em;
}

/* 投稿内のDoneリアクション表示 */
.reaction-btn.done-reaction .emoji {
    color: #17a2b8;
    font-weight: bold;
    letter-spacing: -0.5px;
    font-size: 0.9em;
}

/* リアクションユーザー表示ツールチップ */
.reaction-tooltip {
    position: absolute;
    background: #2d3748;
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.85em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    pointer-events: none;
    max-width: 280px;
}

.reaction-tooltip.show {
    opacity: 1;
    transform: translateY(0);
}

.reaction-tooltip-content {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.reaction-user {
    white-space: nowrap;
}

.reaction-user.legacy {
    color: #a0aec0;
    font-style: italic;
}


.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.modal-overlay.show {
    display: block;
}

/* モーダル共通スタイル */
.modal-dialog {
    max-width: 90%;
    margin: 1.75rem auto;
}

.modal-content {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 3px 6px rgba(0,0,0,0.16);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    padding: 1rem;
}

/* 画像投稿確認モーダル */
#imageConfirmModal .modal-dialog {
    max-width: 500px;
    margin: 1.75rem auto;
}

#imageConfirmModal .modal-body {
    padding: 1.5rem;
}

#imageConfirmModal .list-unstyled {
    margin-bottom: 0;
}

#imageConfirmModal .list-unstyled li {
    position: relative;
    padding-left: 1.5em;
    line-height: 1.6;
    display: block;
    width: 100%;
}

#imageConfirmModal .list-unstyled li::before {
    content: "•";
    position: absolute;
    left: 0.5em;
}

#imageConfirmModal .modal-body > div {
    display: block;
    width: 100%;
}

#imageConfirmModal .modal-body p {
    width: 100%;
    margin-bottom: 0;
}

/* 画像表示モーダル */
#commonImageModal .modal-body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
}

#commonImageModal .modal-image {
    max-width: 100%;
    min-width: 200px;  /* 小さい画像の最小幅を設定 */
    height: auto;
    cursor: pointer;
}

/* モーダル背景 */
.modal-backdrop.show {
    opacity: 0.2;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 1rem;
    }
}

/* 削除された投稿のスタイル */
.deleted-post {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin: 5px 0;
    opacity: 0.7;
}

.deleted-post .text-muted {
    font-style: italic;
}

/* 編集済み投稿の表示 */
.edit-info {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid #e9ecef;
}

/* 投稿ヘッダーの右側 */
.post-header-right {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 編集フォーム */
.edit-form {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 10px;
    margin-top: 10px;
}

.edit-form textarea {
    resize: vertical;
    min-height: 100px;
}

/* 編集・削除ボタン */
.post-item .btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
}

.post-item .btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
}

.post-item .btn-outline-danger:hover {
    background-color: #dc3545;
    border-color: #dc3545;
}

/* ミュートユーザーの投稿スタイル */
.muted-post {
    position: relative;
    min-height: 60px;
}

.muted-post-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    border-radius: 4px;
    border: 1px dashed #adb5bd;
    transition: all 0.2s ease;
}

.muted-post-number {
    position: absolute;
    top: 8px;
    right: 12px;
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.muted-post-overlay:hover {
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
    border-color: #6c757d;
}

.muted-post-message {
    text-align: center;
    color: #6c757d;
}

.muted-post-message i {
    font-size: 1.2rem;
    display: block;
    margin-bottom: 4px;
}

.muted-post-message span {
    display: block;
    font-weight: 500;
    font-size: 0.9rem;
}

.muted-post-message small {
    display: block;
    opacity: 0.7;
    font-size: 0.75rem;
    margin-top: 2px;
}

.muted-post-content {
    /* デフォルトは非表示 */
}

.muted-post.revealed .muted-post-overlay {
    display: none;
}

.muted-post.revealed .muted-post-content {
    display: block !important;
}

/* ミュート表示中の投稿に視覚的なマーカーを追加 */
.muted-post.revealed {
    border-left: 3px solid #adb5bd;
    padding-left: 10px;
}

/* ミュート投稿のポップアップ表示用スタイル */
.muted-popup-content {
    padding: 10px 15px;
    min-width: 200px;
}

.muted-popup-header {
    text-align: right;
    margin-bottom: 8px;
}

.muted-popup-number {
    color: #6c757d;
    font-size: 0.9rem;
    font-weight: 500;
}

.muted-popup-message {
    text-align: center;
    color: #6c757d;
    padding: 10px 0;
}

.muted-popup-message i {
    display: block;
    font-size: 1.2rem;
    margin-bottom: 6px;
}

.muted-popup-message span {
    font-size: 0.9rem;
}

