/**
 * 共通CSS
 *
 * 全ページで使用する共通スタイル
 */

/* リセット */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ベーススタイル */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

/* リンク */
a {
    color: #3498db;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ボタン */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.3s;
}

.btn:hover {
    background: #2980b9;
}

.btn-secondary {
    background: #95a5a6;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: #e74c3c;
}

.btn-danger:hover {
    background: #c0392b;
}

/* フォーム */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #3498db;
}

/* エラーメッセージ（バリデーション共通） */
.error-message {
    color: #721c24;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    font-size: 13px;
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 10px;
    margin-bottom: 10px;
    display: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

/* ページヘッダー（サブページ共通） */
.page-header {
    position: relative;
    text-align: center;
    padding: 15px;
    background: white;
    border-bottom: 1px solid #eee;
}
.page-header h1 {
    font-size: 20px;
    color: #333;
    margin: 0;
}
.page-header .page-back-btn {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}
.page-header .page-header-action {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #3498db;
    text-decoration: none;
    font-size: 14px;
}

/* 固定ページ(about/guide/terms/contact)の本文見出しh1: コンテンツと左右パディングを揃える */
body.layout-left-only .main-feed > h1 {
    padding: 16px 20px 0; /* PC: 上にもパディングを追加 */
}
@media (max-width: 599px) {
    body.layout-left-only .main-feed > h1 {
        font-size: 18px;     /* SPでは見出しをさらに小さく */
        line-height: 1.3;    /* 行間を少し詰める（body継承の1.6→1.3） */
        padding: 12px 20px;  /* SP: 上下にもパディングを追加 */
    }
}

/* 検索結果バー（一覧ページ内検索時に表示） */
.search-result-bar {
    padding: 8px 15px;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-size: 14px;
    color: #666;
}
.search-result-bar a {
    margin-left: 8px;
    color: #3498db;
}

/* 戻るリンク */
.back-link {
    text-align: center;
    padding: 20px;
}
.back-link a {
    color: #3498db;
    text-decoration: none;
}

/* フォームカード */
.form-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.form-card h2 {
    margin-top: 0;
    font-size: 18px;
    border-bottom: 2px solid #3498db;
    padding-bottom: 10px;
}

/* 成功メッセージ */
.success {
    background: #d4edda;
    color: #155724;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #c3e6cb;
}

/* ユーティリティ */
.text-center {
    text-align: center;
}

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * X風 3パネルレイアウト（共通）
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.x-layout {
    display: flex;
    justify-content: center;
    min-height: 100vh;
    max-width: 1280px;
    margin: 0 auto;
}
.sidebar-left {
    display: none;
}
.main-feed {
    flex: 1;
    max-width: 450px;
    min-width: 0;
}
.sidebar-right {
    display: none;
}

/* タブレット+ (600px以上): 3パネルの基底スタイル
   左サイドバーは「テキスト付き 320px」を基本にし、画面が狭くなったら
   まず右カラム → 次に左カラム（アイコン化）の順で削る。 */
@media (min-width: 600px) {
    .x-layout-page {
        padding-bottom: 0;
        background: white;
    }
    .sidebar-left {
        display: block;
        flex: 0 0 320px;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        padding: 20px 12px;
        border-right: 1px solid #eee;
    }
    .main-feed {
        flex: 0 0 450px;
        max-width: none;
        border-left: 1px solid #eee;
        border-right: 1px solid #eee;
    }
    .sidebar-right {
        display: block;
        flex: 1;
        min-width: 0;
        position: sticky;
        top: 0;
        height: 100vh;
        overflow-y: auto;
        padding: 20px 16px;
    }
    /* 左サイドバーのみ（右なし）: メインが広がる */
    body.layout-left-only .main-feed {
        flex: 1;
        border-right: none;
    }
    /* テキスト付きフル表示（基底） */
    .sidebar-nav .nav-divider { margin: 4px 8px; }
    .sidebar-nav .nav-label { display: inline; }
    .sidebar-nav a {
        justify-content: flex-start;
        gap: 12px;
        padding: 10px 12px;
    }
    .sidebar-logo {
        justify-content: flex-start;
        gap: 10px;
        padding: 8px 12px;
    }
    .sidebar-logo .nav-label { display: inline; }
    .sidebar-logo .sidebar-logo-full { display: block; }
    .sidebar-logo .sidebar-logo-mark { display: none; }
    .sidebar-catch { display: block; }
    .top-sidebar-cta {
        justify-content: flex-start;
        padding: 14px 12px;
        gap: 10px;
    }
    .top-sidebar-cta .nav-label { display: inline; }
    .top-sidebar-description,
    .top-sidebar-features,
    .top-sidebar-note,
    .top-sidebar-lead,
    .top-sidebar-encouragement { display: block; }
    .top-sidebar-user {
        display: flex;
        justify-content: flex-start;
        align-items: center;
        gap: 12px;
        padding: 12px 8px;
        margin: 12px 0;
    }
    .top-sidebar-user-details { display: block; }
    .top-sidebar-user-icon {
        width: 48px;
        height: 48px;
    }
}

/* 狭めPC (600-1099px): 右サイドバーを隠して左+本文を優先 */
@media (min-width: 600px) and (max-width: 1099px) {
    .sidebar-right { display: none; }
    .main-feed { border-right: none; }
}

/* さらに狭いPC (600-879px): 左サイドバーをアイコンモードに圧縮
   320 + 450 = 770 が左+本文の合計幅。880px 以下ではテキスト付きの
   左カラムが本文を窮屈にするのでアイコン化（72px）に切り替える。 */
@media (min-width: 600px) and (max-width: 879px) {
    .sidebar-left {
        flex: 0 0 72px;
        padding: 12px 8px;
    }
    .sidebar-nav .nav-label { display: none; }
    .sidebar-nav a {
        justify-content: center;
        gap: 0;
        padding: 12px 8px;
    }
    .sidebar-logo {
        justify-content: center;
        gap: 0;
        padding: 8px;
    }
    .sidebar-logo .nav-label { display: none; }
    .sidebar-logo .sidebar-logo-full { display: none; }
    .sidebar-logo .sidebar-logo-mark { display: block; }
    .sidebar-logo-mark.sidebar-logo-svg {
        height: 44px;
        width: 44px;
        border-radius: 8px;
    }
    .sidebar-catch { display: none; }
    .top-sidebar-cta {
        justify-content: center;
        padding: 12px 8px;
        gap: 0;
    }
    .top-sidebar-cta .nav-label { display: none; }
    .top-sidebar-description,
    .top-sidebar-features,
    .top-sidebar-note,
    .top-sidebar-lead,
    .top-sidebar-encouragement { display: none; }
    .top-sidebar-user {
        justify-content: center;
        padding: 8px 0;
        margin: 8px 0;
    }
    .top-sidebar-user-details { display: none; }
    .top-sidebar-user-icon {
        width: 40px;
        height: 40px;
    }
}

/* サイドバーロゴ */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    margin-bottom: 12px;
    text-decoration: none;
    color: #3498db;
    border-radius: 8px;
    transition: background 0.2s;
}
.sidebar-logo:hover {
    background: #f0f0f0;
    text-decoration: none;
}
.sidebar-logo-svg {
    height: 46px;
    width: auto;
    display: block;
    margin: 0 auto;
}

/* 左サイドバー ナビ */
.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}
.sidebar-nav li {
    margin-bottom: 2px;
}
.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: #333;
    font-size: 15px;
    border-radius: 8px;
    transition: background 0.2s;
}
.sidebar-nav a:hover {
    background: #f0f0f0;
    text-decoration: none;
}
.sidebar-nav a.active {
    font-weight: bold;
    color: #3498db;
    background: #eef6fd;
}
.sidebar-nav .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}
.sidebar-nav .nav-divider {
    border-top: 1px solid #e0e0e0;
    margin: 6px 12px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * サイドバー CTAボタン・ユーザー情報（共通）
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* CTAボタン共通 */
.top-sidebar-cta {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 12px;
    margin-bottom: 8px;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: opacity 0.2s;
}
.top-sidebar-cta:hover {
    opacity: 0.85;
    text-decoration: none;
    color: white;
}
.top-sidebar-cta-icon {
    font-size: 20px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}
.top-sidebar-cta-register {
    background: #c0392b;
}
.sidebar-catch {
    text-align: center;
    color: #c0392b;
    font-size: 13px;
    font-weight: 800;
    padding: 4px 0;
}
.top-sidebar-cta-post {
    background: #22709c;
}
.top-sidebar-cta-request {
    background: #aa5c14;
}

/* 説明テキスト */
.top-sidebar-description {
    padding: 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.7;
}
.top-sidebar-note {
    font-size: 12px;
    color: #6b6b6b;
    margin-bottom: 8px;
}
.top-sidebar-lead {
    margin-bottom: 6px;
}
.top-sidebar-features {
    list-style: disc;
    margin-left: 18px;
    font-size: 13px;
}
.top-sidebar-features li {
    margin-bottom: 2px;
}
.top-sidebar-encouragement {
    font-size: 12px;
    color: #888;
    line-height: 1.7;
}

/* ユーザー情報 */
.top-sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 12px;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    margin: 8px 0;
}
.top-sidebar-user-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
    flex-shrink: 0;
}
.top-sidebar-user-details {
    flex: 1;
    min-width: 0;
}
.top-sidebar-username {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.top-sidebar-logout {
    font-size: 12px;
    color: #e74c3c;
    text-decoration: none;
}
.top-sidebar-logout:hover {
    text-decoration: underline;
}

/* サイドバーナビ（CTA付き） */
.top-sidebar-nav {
    margin-top: 4px;
}

/* 狭めPC(600-879px): CTA・ユーザー情報をアイコン化（左サイドバーがアイコンモードに同調） */
@media (min-width: 600px) and (max-width: 879px) {
    .top-sidebar-cta {
        justify-content: center;
        padding: 14px 8px;
        gap: 0;
    }
    .top-sidebar-cta .nav-label {
        display: none;
    }
    .top-sidebar-description {
        display: none;
    }
    .top-sidebar-user {
        flex-direction: column;
        padding: 12px 4px;
        gap: 4px;
    }
    .top-sidebar-user-icon {
        width: 36px;
        height: 36px;
    }
    .top-sidebar-user-details {
        display: none;
    }
    .top-sidebar-nav .nav-label {
        display: none;
    }
    .top-sidebar-nav a {
        justify-content: center;
        gap: 0;
        padding: 12px 8px;
    }
    .top-sidebar-nav .nav-divider {
        margin: 4px 8px;
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 投稿一覧（共通）
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.posts-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
}
.posts-grid .post-card {
    position: relative;
    background: white;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    padding: 12px 16px;
}
/* カード全面を覆う詳細ページへのオーバーレイリンク（aria-labelで名前を付与） */
.post-card-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    cursor: pointer;
}
/* カード内の投稿者リンク（オーバーレイより前面に） */
.post-card-user-link {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    color: inherit;
    position: relative;
    z-index: 11;
}
.posts-grid .post-card:hover {
    background: #f8f9fa;
    text-decoration: none;
}
.posts-grid .post-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    background: #eee;
    margin: 8px 0 0 0;
    padding: 0;
    display: block;
    border-radius: 16px;
}
.posts-grid .post-info {
    padding: 0;
}
.posts-grid .post-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}
.posts-grid .post-user {
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}
.posts-grid .post-user-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    background: #ddd;
}
.posts-grid .post-date {
    font-size: 12px;
    color: #999;
    margin-left: auto;
    white-space: nowrap;
}
.posts-grid .post-reactions {
    display: flex;
    gap: 8px;
    margin-top: 5px;
    font-size: 11px;
    color: #999;
}
.posts-grid .post-reactions span {
    display: flex;
    align-items: center;
    gap: 2px;
}
.posts-grid .no-posts {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* X埋め込み（投稿リスト内） */
.posts-grid .x-embed-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f8f9fa;
    overflow: hidden;
    position: relative;
    margin: 8px 0 0 0;
    padding: 0;
}
.posts-grid .x-embed-loading {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.posts-grid .x-embed-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to bottom, transparent, white);
    pointer-events: none;
    z-index: 5;
}
.posts-grid .x-embed-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 125%;
    height: 125%;
    transform: scale(0.8);
    transform-origin: top left;
    overflow: hidden !important;
}
.posts-grid .x-embed-container .twitter-tweet {
    margin: 0 !important;
}

/* ローディング・終了メッセージ */
.post-list-loading {
    text-align: center;
    padding: 60px 20px;
    margin-bottom: 50%;
    display: none;
}
.post-list-loading .spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: post-list-spin 1s linear infinite;
    margin: 0 auto 15px;
}
@keyframes post-list-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.post-list-end {
    text-align: center;
    padding: 20px;
    color: #999;
    display: none;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 通知トースト
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

.notification-toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.notification-toast {
    pointer-events: auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    max-width: 360px;
    min-width: 280px;
    cursor: pointer;
    overflow: hidden;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.notification-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.notification-toast-inner {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
}

.notification-toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
}

.notification-toast-content {
    flex: 1;
    min-width: 0;
    font-size: 13px;
    line-height: 1.4;
    color: #333;
}

.notification-toast-actor {
    font-weight: bold;
}

.notification-toast-message {
    color: #555;
}

.notification-toast-close {
    background: none;
    border: none;
    color: #999;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
    line-height: 1;
}

.notification-toast-close:hover {
    color: #333;
}

/* SP用: 上部中央に配置 */
@media (max-width: 480px) {
    .notification-toast-container {
        top: 8px;
        right: 8px;
        left: 8px;
    }
    .notification-toast {
        max-width: none;
        min-width: 0;
    }
}

/* 未読バッジ */
.notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    line-height: 1;
}

/* リクエスト投稿バッジ */
.badge-request {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
    margin-right: 6px;
    vertical-align: middle;
    line-height: 1.2;
}

/* ━━━ 右サイドバー: 検索バー ━━━ */
.sidebar-search {
    margin-bottom: 16px;
}
.sidebar-search input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #eee;
    border-radius: 50px;
    font-size: 14px;
    background: #f7f9fa;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.sidebar-search input:focus {
    border-color: #3498db;
    background: white;
}

/* ━━━ 右サイドバー: カードセクション共通 ━━━ */
.trending-section {
    background: #f7f9fa;
    border-radius: 16px;
    padding: 16px;
}
.trending-section h2,
.trending-section h3 {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 12px;
    color: #333;
}
.trending-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    text-decoration: none;
    color: inherit;
    transition: background 0.2s;
}
.trending-item:last-child {
    border-bottom: none;
}
.trending-item:hover {
    background: #f0f0f0;
    margin: 0 -16px;
    padding: 12px 16px;
    border-radius: 8px;
}
.trending-rank {
    font-size: 18px;
    font-weight: bold;
    color: #22709c;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}
.trending-thumb {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: #ddd;
    flex-shrink: 0;
}
.sidebar-thumb-x {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}
.sidebar-thumb-x svg {
    fill: white;
}
.sidebar-thumb-tiktok {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
}
.sidebar-thumb-tiktok svg {
    fill: #000;
}
.trending-info {
    flex: 1;
    min-width: 0;
}
.trending-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.trending-meta {
    font-size: 12px;
    color: #6b6b6b;
    margin-top: 4px;
}

/* ━━━ サイト情報リンク ━━━ */

/* PC/タブレット: 右サイドバー内カード */
.info-links-card {
    background: #eaf6ff;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 16px;
}
.info-links-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    margin-bottom: 4px;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s;
}
.info-links-item:last-child {
    margin-bottom: 0;
}
.info-links-item:hover {
    background: rgba(52, 152, 219, 0.1);
}
.info-links-icon {
    font-size: 18px;
    flex-shrink: 0;
    width: 24px;
    text-align: center;
}

/* SP: ヘッダー下リンクバー */
.info-links-bar {
    display: flex;
    justify-content: center;
    justify-content: safe center; /* SPではみ出す時は先頭から見えるよう左寄せにフォールバック */
    gap: 4px;
    padding: 8px 10px;
    background: #f0f8ff;
    border-bottom: 1px solid #dce8f0;
    font-size: 12px;
    flex-wrap: nowrap;
    overflow-x: auto; /* SP: 収まらない分は横スクロール */
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox: スクロールバー非表示 */
}
.info-links-bar::-webkit-scrollbar { display: none; } /* Chrome/Safari: スクロールバー非表示 */
.info-links-bar a {
    color: #22709c;
    text-decoration: none;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
    flex-shrink: 0; /* 縮めず幅を保ってスクロールさせる */
    transition: background 0.2s;
}
.info-links-bar a:hover {
    background: rgba(52, 152, 219, 0.1);
}
/* SP/PCテキスト出し分け */
.info-links-bar-pc { display: none; }
/* タブレット以上: PCテキスト表示 */
@media (min-width: 600px) {
    .info-links-bar {
        gap: 20px;
        padding: 10px 20px;
        font-size: 13px;
    }
    .info-links-bar a {
        padding: 6px 14px;
    }
    .info-links-bar-sp { display: none; }
    .info-links-bar-pc { display: inline; }
}

/* ━━━ フラッシュメッセージ ━━━ */
.flash-message {
    max-width: 600px;
    margin: 10px auto;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    animation: flashFadeOut 3s ease forwards;
}
.flash-success {
    background: #d4edda;
    color: #155724;
}
.flash-error {
    background: #f8d7da;
    color: #721c24;
}
@keyframes flashFadeOut {
    0%, 70% { opacity: 1; }
    100% { opacity: 0; }
}

/* ━━━ サイト共通フッター（アフィリエイト開示＋利用規約導線） ━━━ */
.site-footer {
    padding: 24px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
    color: #666;
    font-size: 12px;
    text-align: center;
    line-height: 1.7;
}
.site-footer p {
    margin-top: 0;
    margin-bottom: 8px;
}
.site-footer p:last-child {
    margin-bottom: 0;
}
.site-footer .site-footer-notice {
    color: #555;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
}
.site-footer-notice strong {
    color: #333;
    font-weight: 600;
}
.site-footer-links a {
    color: #22709c;
    text-decoration: none;
    font-size: 12px;
}
.site-footer-links a:hover {
    text-decoration: underline;
}
.site-footer-sep {
    color: #ccc;
    margin: 0 6px;
}
.site-footer-copyright {
    color: #6b6b6b;
    font-size: 11px;
    margin-top: 10px !important;
}
/* SPではボトムメニューと被らないよう余白を確保 */
@media (max-width: 599px) {
    .site-footer {
        padding-bottom: 80px;
    }
}

/* ━━━ ボトムメニューバー（SP用） ━━━ */
.menu-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    z-index: 1000;
}
.menu-bar .menu-item {
    flex: 1;
    padding: 10px 5px;
    text-align: center;
    text-decoration: none;
    color: #666;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    transition: all 0.2s;
}
.menu-bar .menu-item:hover {
    background: #f8f9fa;
}
.menu-bar .menu-item.active {
    color: #22709c;
}
.menu-icon {
    font-size: 20px;
}
.menu-label {
    font-size: 10px;
}
/* 投稿ボタン: 中央でメニューバーから浮き上がるFAB風 */
.menu-bar .post-btn {
    color: #22709c;
    position: relative;
}
.menu-bar .post-btn .menu-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    margin-top: -18px;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15), 0 0 0 1px rgba(0,0,0,0.05);
    transition: transform 0.15s, box-shadow 0.2s;
}
.menu-bar .post-btn:hover .menu-icon,
.menu-bar .post-btn:active .menu-icon {
    transform: translateY(-2px);
    box-shadow: 0 5px 14px rgba(0,0,0,0.18), 0 0 0 1px rgba(0,0,0,0.05);
}
/* 通知バッジ: 旧 right:-2px だと領域の端で見切れるためアイコン中央寄りに配置 */
.menu-bar .menu-item .notification-badge {
    top: 4px;
    right: auto;
    left: 50%;
    transform: translateX(2px);
}
/* タブレット以上: ボトムメニューバーを非表示（左サイドバーで代替） */
@media (min-width: 600px) {
    .menu-bar {
        display: none;
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * PWAインストール誘導バナー
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ボトムシート型バナー */
.pwa-install-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    transform: translateY(calc(100% + 80px));
    transition: transform 0.3s ease;
    pointer-events: none;
}
.pwa-install-banner.show {
    transform: translateY(0);
}
.pwa-install-banner-inner,
.pwa-install-ios-guide {
    pointer-events: auto;
}
.pwa-install-banner-inner {
    background: #fff;
    border-top: 1px solid #eee;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}
.pwa-install-banner-close {
    position: absolute;
    top: -16px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 18px;
    color: #999;
    cursor: pointer;
    padding: 0;
    line-height: 32px;
    text-align: center;
    z-index: 2;
    box-shadow: 0 1px 4px rgba(0,0,0,0.12);
}
.pwa-install-banner-close:hover { color: #333; background: #f5f5f5; }
.pwa-install-banner-icon img {
    border-radius: 12px;
    display: block;
}
.pwa-install-banner-text {
    flex: 1;
    min-width: 0;
}
.pwa-install-banner-title {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}
.pwa-install-banner-desc {
    font-size: 12px;
    color: #707070;
    margin-top: 2px;
}
.pwa-install-banner-action {
    background: #2471a3;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
    flex-shrink: 0;
}
.pwa-install-banner-action:hover { background: #1d5f8a; }

/* iOS手順ガイド */
.pwa-install-ios-guide {
    background: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 16px 20px;
    max-width: 600px;
    margin: 0 auto;
}
.pwa-install-ios-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.pwa-install-ios-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
}
.pwa-install-ios-step-num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #3498db;
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
    flex-shrink: 0;
}

/* SP: ボトムメニューの上に表示 */
@media (max-width: 599px) {
    .pwa-install-banner {
        bottom: 72px;
    }
}

/* サイドバー「アプリで使う」ボタン（SPではサイドバー自体が非表示なので実質非表示） */
.pwa-install-sidebar-btn {
    display: none;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    color: #3498db;
    font-size: 14px;
    border-radius: 8px;
    cursor: pointer;
    border: 1px dashed #3498db;
    margin-top: 8px;
    background: none;
    width: 100%;
    text-align: left;
    transition: background 0.2s;
}
.pwa-install-sidebar-btn:hover { background: #eef6fd; }
.pwa-install-sidebar-btn .nav-icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}
/* タブレット〜狭めPC (600-879px): サイドバーボタンをアイコンのみに */
@media (min-width: 600px) and (max-width: 879px) {
    .pwa-install-sidebar-btn {
        display: flex;
        justify-content: center;
        gap: 0;
        padding: 12px 8px;
    }
    .pwa-install-sidebar-btn .nav-label { display: none; }
}
/* 中間PC (880-1199px): サイドバーボタンをテキスト付きで表示 */
@media (min-width: 880px) and (max-width: 1199px) {
    .pwa-install-sidebar-btn {
        display: flex;
    }
}

/* 「アプリで開き直す」案内バナー（インストール済み＋ブラウザ訪問時） */
.pwa-reopen-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10001;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
    pointer-events: none;
}
.pwa-reopen-banner.show {
    transform: translateY(0);
}
.pwa-reopen-banner-inner {
    pointer-events: auto;
    background: #eef6fd;
    border-bottom: 1px solid #c4ddf0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 14px 48px 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
}
.pwa-reopen-banner-close {
    position: absolute;
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    background: none;
    border: 1px solid #c4ddf0;
    border-radius: 50%;
    font-size: 16px;
    color: #6ba3d0;
    cursor: pointer;
    padding: 0;
    line-height: 28px;
    text-align: center;
}
.pwa-reopen-banner-close:hover { color: #333; background: #d8eaf8; }
.pwa-reopen-banner-icon img {
    border-radius: 8px;
    display: block;
    flex-shrink: 0;
}
.pwa-reopen-banner-text {
    font-size: 13px;
    color: #2c6fa0;
    line-height: 1.5;
}
.pwa-reopen-banner-sub {
    display: block;
    font-size: 11px;
    color: #7baed4;
    margin-top: 2px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
/* AI要約 (x_summary) - 詳細ページ表示 */
/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.x-summary-block { margin-top: 10px; }
.x-summary-label {
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
    font-weight: bold;
}
.x-summary-list {
    padding: 10px 12px 10px 30px;
    margin: 0;
    background: #fff;
    border-left: 3px solid #1da1f2;
    border-radius: 4px;
    font-size: 13px;
    color: #555;
    line-height: 1.6;
    list-style: disc outside;
}
.x-summary-list--tiktok { border-left-color: #fe2c55; }
.x-summary-list li { margin: 0 0 8px 0; }
.x-summary-list li:last-child { margin-bottom: 0; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   注記スタイル: ※始まりのちょっとした注意書きや補足説明
   - 単独の注記は <p class="note">本文</p>
   - 複数連続する場合は <ul class="note"><li>注1</li><li>注2</li></ul>
   - ※マークは CSS で自動付与（HTML 内に書く必要なし）
   - フォントサイズは親より1段小さく、行頭にぶら下げインデント
   - 色は親から継承。重要警告には .important を追加して赤色化
     例: <p class="note important">本当に重要な注意</p>
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.note {
    font-size: 0.875em;
    line-height: 1.7;
    margin: 8px 0;
}
p.note,
ul.note li {
    padding-left: 1.5em;
    text-indent: -1.5em;
}
p.note::before,
ul.note li::before {
    content: "※ ";
}
ul.note {
    list-style: none;
    padding-left: 0;
}
ul.note li {
    margin: 4px 0;
}
/* important は親(.note) でも子(li 単位) でも赤くできるよう両対応 */
.note.important,
.note .important {
    color: #c0392b;
}

/* ━━━ タグクラウド（PC右サイドバー / SPトップ検索バー上） ━━━ */
/* レイアウト・余白などの共通スタイル。
   フォントサイズ・文字色は common/tag_cloud.css.php が動的に出力する
   .tag-cloud-bucket-1〜5 で上書きされる。 */
.tag-cloud {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
}
.tag-cloud-heading {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #555;
    letter-spacing: 0.05em;
}
.tag-cloud-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    line-height: 1.4;
}
.tag-cloud-item {
    text-decoration: none;
    color: #22709c;
    transition: opacity 0.15s;
    white-space: nowrap;
}
/* SP版はやや密にする */
.tag-cloud-sp {
    padding: 8px 10px;
    margin-bottom: 8px;
}
.tag-cloud-sp .tag-cloud-heading {
    font-size: 12px;
    margin-bottom: 6px;
}
.tag-cloud-sp .tag-cloud-list {
    gap: 4px 8px;
}

/* PC版（右サイドバー）は 600px 以上だけ表示 / SP版（メインフィード内）は 599px 以下だけ表示 */
@media (max-width: 599px) {
    .tag-cloud-pc { display: none; }
}
@media (min-width: 600px) {
    .tag-cloud-sp { display: none; }
}

/* ━━━ 左サイドバー「スマホで見る」QRコードカード ━━━ */
.sidebar-qr-card {
    position: relative;
    margin: 12px 0 0;
    padding: 10px 10px 8px;
    border: 1px solid #d6e4ee;
    border-radius: 8px;
    background: #f5fafd;
    text-align: center;
}
.sidebar-qr-label {
    font-size: 13px;
    font-weight: 600;
    color: #22709c;
    margin-bottom: 6px;
}
.sidebar-qr-img {
    display: block;
    width: 100%;
    max-width: 120px;
    height: auto;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
}
.sidebar-qr-note {
    margin-top: 6px;
    font-size: 11px;
    color: #888;
    line-height: 1.4;
}
.sidebar-qr-close {
    position: absolute;
    top: 2px;
    right: 4px;
    background: none;
    border: none;
    color: #aaa;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 6px;
}
.sidebar-qr-close:hover { color: #555; }

/* SPでは左サイドバー自体が非表示なのでQRも自動的に消える。
   さらに狭めPC (600-879px) ではアイコンのみモードでQRも収まり悪いので非表示。
   880px 以上ならテキスト付きで左サイドバー幅 320px が出ているので QR も表示する。 */
@media (min-width: 600px) and (max-width: 879px) {
    .sidebar-qr-card { display: none; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * ページトップ追従ボタン（全ページ共通・footer.php に配置）
 * 一定量スクロールしたら右下に出現、クリックでスムーズスクロール。
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.page-top-btn {
    position: fixed;
    right: 16px;
    bottom: 80px;            /* SP時の下部メニューバーに被らないよう余裕を取る */
    width: 44px;
    height: 44px;
    border-radius: 8px;
    background: rgba(52, 73, 94, 0.85);
    color: white;
    border: none;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 9000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
    padding: 0;
}
.page-top-btn:hover {
    background: rgba(52, 73, 94, 1);
}
.page-top-btn.visible {
    opacity: 0.9;
    visibility: visible;
    transform: translateY(0);
}
/* PCサイズではメニューバーが無いので bottom を詰める */
@media (min-width: 600px) {
    .page-top-btn {
        bottom: 24px;
        right: 24px;
        width: 48px;
        height: 48px;
        font-size: 18px;
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
 * 中身ワードランキング（PC右サイドバー / SPトップ検索バー上）
 * ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.content-ranking {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 6px;
}
.content-ranking-heading {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px;
    color: #555;
    letter-spacing: 0.05em;
}
.content-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.content-ranking-list li {
    border-bottom: 1px solid #f0f0f0;
}
.content-ranking-list li:last-child { border-bottom: none; }
.content-ranking-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 4px;
    text-decoration: none;
    color: #22709c;
    font-size: 13px;
    transition: background 0.15s;
}
.content-ranking-item:hover {
    background: #eef6fa;
}
.content-ranking-rank {
    flex: 0 0 22px;
    text-align: center;
    color: #999;
    font-size: 11px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.content-ranking-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.content-ranking-count {
    flex: 0 0 auto;
    color: #999;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}
/* SP版は少し詰める＋アコーディオン化（<details>） */
.content-ranking-sp {
    padding: 8px 10px;
    margin-bottom: 8px;
}
/* <summary> がリストを開閉するヘッダー兼ボタン。ページ占有を減らすため畳めるように */
.content-ranking-sp > summary.content-ranking-heading {
    font-size: 12px;
    margin: 0;
    padding: 4px 0;
    cursor: pointer;
    user-select: none;
    list-style: none; /* デフォルト三角マーカーを消して独自表示に */
    display: flex;
    align-items: center;
}
.content-ranking-sp > summary.content-ranking-heading::-webkit-details-marker {
    display: none;
}
/* 開閉表示の小さな三角を独自で出す */
.content-ranking-sp > summary.content-ranking-heading::before {
    content: '▸';
    display: inline-block;
    margin-right: 6px;
    color: #999;
    font-size: 10px;
    transition: transform 0.15s;
}
.content-ranking-sp[open] > summary.content-ranking-heading::before {
    transform: rotate(90deg);
}
.content-ranking-sp[open] > .content-ranking-list {
    margin-top: 6px;
}
.content-ranking-sp .content-ranking-item {
    padding: 4px 2px;
    font-size: 12px;
}

/* PC版（右サイドバー）は 600px 以上、SP版は 599px 以下で出し分け（タグクラウドと整合） */
@media (max-width: 599px) {
    .content-ranking-pc { display: none; }
}
@media (min-width: 600px) {
    .content-ranking-sp { display: none; }
}
