/* ============================================================
   匿名掲示板
   ============================================================ */

.ccb-board {
    max-width: 800px;
    margin: 24px auto;
    padding: 0 16px;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic", sans-serif;
    color: #333;
    line-height: 1.6;
}

/* ===== 投稿フォーム ===== */
.ccb-form-wrap {
    background: linear-gradient(135deg, #f4eeff, #f0f5ff);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 32px;
    box-shadow: 0 4px 12px rgba(160, 107, 255, 0.08);
}

.ccb-form-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: bold;
    color: #7340c4;
}

/* ===== ロック状態（未連携） ===== */
.ccb-form-locked {
    text-align: center;
    padding: 16px 0;
}

.ccb-form-locked-text {
    margin: 0 0 16px;
    font-size: 14px;
    color: #555;
}

.ccb-x-connect-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 32px;
    background: #000;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-weight: bold;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.ccb-x-connect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
    color: #fff;
}

.ccb-form-note {
    margin: 16px 0 0;
    font-size: 11px;
    color: #888;
}

/* ===== フォーム入力 ===== */
.ccb-form-row {
    margin-bottom: 12px;
    position: relative;
}

.ccb-input-name,
.ccb-input-content {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e0d8ff;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    background: #fff;
    box-sizing: border-box;
    font-family: inherit;
    line-height: 1.6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.ccb-input-name:focus,
.ccb-input-content:focus {
    outline: none;
    border-color: #a06bff;
    box-shadow: 0 0 0 3px rgba(160, 107, 255, 0.15);
}

.ccb-input-content {
    resize: vertical;
    min-height: 80px;
}

.ccb-char-count {
    text-align: right;
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.ccb-char-count.is-warn { color: #ff8800; }
.ccb-char-count.is-over { color: #d63d77; font-weight: bold; }

/* ===== 画像アップロード ===== */
.ccb-image-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccb-image-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #fff;
    border: 1px dashed #c4b5d8;
    border-radius: 10px;
    color: #7340c4;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    align-self: flex-start;
}

.ccb-image-btn:hover {
    background: #fdf5ff;
    border-color: #a06bff;
}

.ccb-image-input {
    display: none;
}

.ccb-image-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ccb-preview-item {
    position: relative;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e0d8ff;
}

.ccb-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.ccb-preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ccb-preview-remove:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* ===== ハニーポット（完全非表示） ===== */
.ccb-honeypot {
    position: absolute !important;
    left: -9999px !important;
    top: -9999px !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* ===== フォームアクション ===== */
.ccb-form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    gap: 12px;
}

.ccb-x-logout {
    font-size: 11px;
    color: #999;
    text-decoration: none;
}

.ccb-x-logout:hover {
    color: #666;
    text-decoration: underline;
}

.ccb-submit-btn {
    padding: 10px 28px;
    background: linear-gradient(135deg, #ff6b9d, #a06bff);
    color: #fff;
    border: none;
    border-radius: 999px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(160, 107, 255, 0.3);
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

.ccb-submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(160, 107, 255, 0.4);
}

.ccb-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ===== メッセージ ===== */
.ccb-form-message {
    margin-top: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    display: none;
}

.ccb-form-message.is-error {
    display: block;
    background: #ffe4ee;
    color: #d63d77;
    border: 1px solid #ffc4d8;
}

.ccb-form-message.is-success {
    display: block;
    background: #e0f7e3;
    color: #2d8a3d;
    border: 1px solid #b8eac0;
}

/* ===== 投稿一覧 ===== */
.ccb-posts-title {
    margin: 0 0 16px;
    font-size: 16px;
    font-weight: bold;
    color: #7340c4;
}

.ccb-posts-count {
    font-size: 12px;
    color: #999;
    font-weight: normal;
}

.ccb-empty {
    padding: 40px 20px;
    text-align: center;
    color: #888;
    background: #fdf5ff;
    border-radius: 12px;
    font-size: 14px;
}

.ccb-posts-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* ===== 個別投稿 ===== */
.ccb-post {
    background: #fff;
    border: 1px solid #f0e8ff;
    border-radius: 12px;
    padding: 14px 16px;
    transition: box-shadow 0.2s;
    scroll-margin-top: 80px;
}

.ccb-post:target {
    border-color: #a06bff;
    box-shadow: 0 0 0 3px rgba(160, 107, 255, 0.2);
}

.ccb-post-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-size: 12px;
    flex-wrap: wrap;
}

.ccb-post-id {
    color: #a06bff;
    font-weight: bold;
}

.ccb-post-name {
    color: #555;
    font-weight: 500;
}

.ccb-post-time {
    color: #999;
    margin-left: auto;
}

.ccb-post-reply-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border: 1px solid #e0d8ff;
    border-radius: 999px;
    background: #fff;
    color: #7340c4;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
}

.ccb-post-reply-btn:hover {
    background: #fdf5ff;
    border-color: #a06bff;
}

.ccb-post-body {
    font-size: 14px;
    color: #333;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.ccb-post-body a {
    color: #4d9bff;
    text-decoration: none;
}
.ccb-post-body a:hover {
    text-decoration: underline;
}

/* レス番号引用リンク */
.ccb-reply-link {
    color: #a06bff !important;
    font-weight: bold;
    background: #f4eeff;
    padding: 1px 6px;
    border-radius: 4px;
    text-decoration: none !important;
    font-size: 13px;
}

.ccb-reply-link:hover {
    background: #e8dfff;
}

/* ===== 画像 ===== */
.ccb-post-images {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.ccb-post-image {
    display: block;
    width: 120px;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f4eeff;
    transition: transform 0.2s;
}

.ccb-post-image:hover {
    transform: scale(1.03);
}

.ccb-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== ページネーション ===== */
.ccb-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.ccb-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #e0d8ff;
    color: #7340c4;
    text-decoration: none;
    font-size: 13px;
    transition: background 0.2s, border-color 0.2s;
}

.ccb-pagination .page-numbers:hover {
    background: #fdf5ff;
    border-color: #a06bff;
}

.ccb-pagination .page-numbers.current {
    background: linear-gradient(135deg, #ff6b9d, #a06bff);
    border-color: transparent;
    color: #fff;
    font-weight: bold;
}

.ccb-pagination .page-numbers.dots {
    border: none;
    background: transparent;
}

/* ===== 画像拡大モーダル ===== */
.ccb-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    align-items: center;
    justify-content: center;
    padding: 20px;
    cursor: zoom-out;
}

.ccb-modal.is-open {
    display: flex;
}

.ccb-modal img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ===== ぼかし表示（プレビュー） ===== */
.ccb-post.is-blurred {
    position: relative;
    user-select: none;
    pointer-events: none;
    overflow: hidden;
}
.ccb-post.is-blurred .ccb-post-body {
    filter: blur(5px);
    opacity: 0.7;
}
.ccb-post.is-blurred .ccb-post-name {
    filter: blur(3px);
}
.ccb-post.is-blurred .ccb-post-images img {
    filter: blur(8px);
}

/* グラデフェード（最後のプレビュー投稿に適用） */
.ccb-board.is-locked .ccb-posts-list .ccb-post:last-child {
    position: relative;
}
.ccb-board.is-locked .ccb-posts-list .ccb-post:last-child::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, transparent 40%, #fff 100%);
    pointer-events: none;
}

/* ===== プレビュー終了CTA ===== */
.ccb-preview-cta {
    margin-top: 24px;
    padding: 32px 20px;
    background: linear-gradient(135deg, #f4eeff 0%, #f0f5ff 100%);
    border: 2px dashed #c4b5d8;
    border-radius: 16px;
    text-align: center;
}

.ccb-preview-cta-icon {
    margin-bottom: 12px;
    color: #a06bff;
    line-height: 0;
}

.ccb-preview-cta-icon svg {
    display: inline-block;
}

.ccb-preview-cta-title {
    margin: 0 0 12px;
    font-size: 18px;
    color: #7340c4;
    font-weight: bold;
}

.ccb-preview-cta-text {
    margin: 0 0 20px;
    font-size: 14px;
    color: #555;
    line-height: 1.7;
}

.ccb-preview-cta-text strong {
    color: #a06bff;
}

.ccb-preview-cta .ccb-x-connect-btn {
    margin-top: 4px;
}

/* ===== SP（768px以下） ===== */
@media (max-width: 768px) {
    .ccb-board {
        padding: 0 12px;
    }

    .ccb-form-wrap {
        padding: 16px;
        border-radius: 12px;
    }

    .ccb-post-image {
        width: calc(50% - 3px);
        height: auto;
        aspect-ratio: 1 / 1;
    }

    .ccb-post-time {
        margin-left: 0;
        width: 100%;
        order: 99;
    }

    .ccb-form-actions {
        flex-direction: column-reverse;
        align-items: stretch;
        gap: 8px;
    }

    .ccb-submit-btn {
        width: 100%;
    }

    .ccb-x-logout {
        text-align: center;
    }
}