/* ===========================
   リセット・ベース
   =========================== */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    overflow-y: scroll;
    /* スクロールバー常時表示でページ間のズレを防止 */
}

:root {
    /* カラーパレット（ライトテーマ） */
    --bg-body: #f4f4f4;
    --bg-white: #ffffff;
    --bg-card: #ffffff;
    --bg-card-hover: #f4f5f7;
    --header-bg: #1a1a1a;
    --header-text: #ffffff;
    --footer-bg: #1a1a1a;
    --footer-text: #ffffff;
    --text-primary: #222222;
    /* より濃い黒に変更 */
    --text-secondary: #555555;
    /* #666 -> #555 少し濃く */
    --text-muted: #777777;
    /* #999 -> #777 少し濃く（サイト名バッジなど） */
    --accent: #ff6600;
    --accent-hover: #e55b00;
    --link: #0077cc;
    --link-hover: #0055aa;
    --border: #e0e0e0;
    --border-light: #eeeeee;
    --border-strong: #d0d0d0;
    --border-article: #c0c0c0;
    --border-article-bottom: #999;
    --badge-bg: #f5f5f5;
    --radius: 8px;
    --radius-sm: 6px;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: 0.15s ease;
    /* カテゴリバー */
    --category-bg: #ffffff;
    --category-text: #333333;
    --category-hover-bg: #f9f9f9;
    --category-active-text: #000000;
    --category-active-border: #000000;
    /* ナビメニュー */
    --nav-bg: #1a1a1a;
    --nav-border: rgba(255, 255, 255, 0.1);
    --nav-hover-bg: rgba(255, 255, 255, 0.1);
    /* セクションヘッダー */
    --section-header-bg: #1a1a1a;
    --section-header-text: #ffffff;
    /* カード内記事（PC表示時: #4d4d4d / スマホ表示時: #333333） */
    --article-text: #4d4d4d;
    --article-bg: #ffffff;
    /* モーダル */
    --modal-bg: #ffffff;
    --modal-border: #e0e0e0;
    --modal-item-border: #f0f0f0;
    /* ケバブメニュー */
    --kebab-bg: #ffffff;
    --kebab-hover-bg: #f5f5f5;
    --kebab-separator: #e8e8e8;
}

/* ダークモード */
body.dark-mode {
    --bg-body: #1a1a2e;
    --bg-white: #252540;
    --bg-card: #252540;
    --bg-card-hover: #2e2e48;
    --header-bg: #0f0f1a;
    --header-text: #ffffff;
    --footer-bg: #0f0f1a;
    --footer-text: #cccccc;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #808080;
    --accent: #ff8833;
    --accent-hover: #ff7711;
    --link: #64b5f6;
    --link-hover: #90caf9;
    --border: #3a3a50;
    --border-light: #2e2e48;
    --border-strong: #404060;
    --border-article: #404060;
    --border-article-bottom: #505070;
    --badge-bg: #2e2e48;
    --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.2);
    --shadow-hover: 0 2px 8px rgba(0, 0, 0, 0.3);
    /* カテゴリバー */
    --category-bg: #252540;
    --category-text: #c0c0c0;
    --category-hover-bg: #2e2e48;
    --category-active-text: #ffffff;
    --category-active-border: #64b5f6;
    /* ナビメニュー */
    --nav-bg: #0f0f1a;
    --nav-border: rgba(255, 255, 255, 0.08);
    --nav-hover-bg: rgba(255, 255, 255, 0.08);
    /* セクションヘッダー */
    --section-header-bg: #0f0f1a;
    --section-header-text: #e0e0e0;
    /* カード内記事 */
    --article-text: #c0c0c0;
    --article-bg: #2a2a45;
    /* モーダル */
    --modal-bg: #252540;
    --modal-border: #3a3a50;
    --modal-item-border: #2e2e48;
    /* ケバブメニュー */
    --kebab-bg: #252540;
    --kebab-hover-bg: #2e2e48;
    --kebab-separator: #3a3a50;
}

/* ダークモード時の画像（サムネイル・ファビコン）のまぶしさ軽減 */
body.dark-mode img {
    filter: brightness(0.8) contrast(1.1);
}

body {
    font-family: 'Segoe UI', 'Hiragino Sans', 'Meiryo', 'Yu Gothic', sans-serif;
    background: var(--bg-body);
    color: var(--text-primary);
    line-height: 1.7;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ===========================
   レイアウト
   =========================== */
.container {
    max-width: 1010px;
    /* カード3列(310*3+24*2=978px) + パディング(16*2=32px) = 1010px に調整して左端を揃える */
    margin: 0 auto;
    padding: 0 16px;
    width: 100%;
}

main.container {
    flex: 1;
    background: transparent;
    /* 背景透過（bodyのグレーが見えるように） */
    border: none;
    box-shadow: none;
    margin-top: 24px;
    margin-bottom: 40px;
    padding: 0 16px;
    /* 左右に16pxの余白を追加し、スマホ画面端への張り付きを防止 */
    /* フラットに配置 */
}

/* ===========================
   ヘッダー（黒・サイト名のみ）
   =========================== */
.site-header {
    background: var(--header-bg);
    padding: 14px 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* 両端揃え */
    position: relative;
}

.site-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--header-text);
    letter-spacing: 0.02em;
    flex: 1;
    /* タイトルが左側を占める */
}

.site-title a {
    color: inherit;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.site-logo {
    display: block;
    height: 20px;
    width: auto;
    max-width: 100%;
    margin-top: 6px;
}

/* ===========================
   バーガーメニュー
   =========================== */
.burger-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 100;
    margin-right: 30px;
    /* 40px->30px (10px右に移動) */
}

.nav-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 200px;
    background: var(--nav-bg);
    /* ヘッダーと同じ黒 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    border-radius: 0 0 4px 4px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 99;
}

.nav-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu ul {
    list-style: none;
    padding: 10px 0;
}

.nav-menu li {
    border-bottom: 1px solid var(--nav-border);
}

.nav-menu li:last-child {
    border-bottom: none;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.nav-menu a:hover {
    background: var(--nav-hover-bg);
}

/* ===========================
   カテゴリメニュー（ヘッダー下・白帯）
   =========================== */
.category-bar {
    background: var(--category-bg);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
    border-bottom: 1px solid var(--border);
    /* 下線を追加してくっきりさせる */
    position: relative;
    z-index: 10;
}

.category-bar .container {
    padding: 0;
}

.category-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    overflow-x: auto;
    /* モバイルで横スクロール可能に */
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    position: relative;
}

.category-list::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.category-list li {
    margin: 0;
}

.category-list a {
    display: block;
    padding: 12px 16px;
    text-decoration: none;
    color: var(--category-text);
    font-weight: 700;
    font-size: 0.9rem;
    position: relative;
    border-bottom: 3px solid transparent;
    /* 高さを維持するための透明なボーダー */
    transition: color 0.2s, background-color 0.2s;
}

/* 丸みを帯びた下線用の擬似要素 */
.category-list a::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 8px;
    right: 8px;
    height: 3px;
    background-color: transparent;
    border-radius: 3px 3px 0 0;
    /* 上側を角丸に */
    transition: background-color 0.2s;
}

@media (hover: hover) {
    .category-list a:hover {
        color: var(--category-active-text);
        background-color: var(--category-hover-bg);
    }
}

.category-list a.active {
    color: var(--category-active-text);
    /* アクティブ時は擬似要素で黒い下線を表示 */
}

.category-list a.active::after {
    background-color: var(--category-active-border);
}

/* スマホ用スライドインジケーター */
.category-indicator {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background-color: var(--category-active-border);
    border-radius: 3px 3px 0 0;
    pointer-events: none;
    will-change: transform, width;
    z-index: 1;
}

.category-bar {
    container-type: inline-size;
}

/* スマホ表示時およびプレビュー枠でのカテゴリバー余白リセット */
.sim-375 .category-bar .container,
.sim-390 .category-bar .container {
    padding-left: 0 !important;
    padding-right: 0 !important;
}

@media (max-width: 768px) {
    .category-bar .container,
    .page-index .category-bar .container {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }
}

/* スマホ表示時のカテゴリバースタイル */
@media (max-width: 768px) {
    .category-list {
        padding-left: 6px;
    }

    .category-list a {
        padding: 10px 12.5px;
        font-size: 0.85rem;
    }

    .category-list.has-indicator a::after {
        display: none;
    }
}

/* 幅 375px 付近（iPhone SE / 8 / X / 12mini / 13mini 等）: アニメまで綺麗に収め、漫画を完全に画面外へ */
@media (max-width: 380px) {
    .category-list a {
        padding: 10px 13px;
    }
}

/* 幅 390px〜400px（iPhone 12 / 13 / 14 / 15 / 16 等）: アニメまで綺麗に収め、漫画を完全に画面外へ */
@media (min-width: 381px) and (max-width: 400px) {
    .category-list a {
        padding: 10px 14.2px;
    }
}

/* プレビュー枠連動用スタイル */
.sim-375 .category-list,
.sim-390 .category-list {
    padding-left: 6px !important;
}
.sim-375 .category-list a {
    padding: 10px 13px !important;
}
.sim-390 .category-list a {
    padding: 10px 14.2px !important;
}
.sim-375,
.sim-390 {
    --article-text: #333333;
}

/* ===========================
   記事リスト（index.php）
   =========================== */
/* 新着一覧ページのラッパー（デザイン削除・透明化） */
.list-articles-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 16px;
}

.list-articles-wrap .article-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.list-articles-wrap .article-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    margin-bottom: 6px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background 0.1s, border-color 0.1s;
}

/* 見出しと合体する最初の要素は上のボーダーを消し、上部の角丸も消して自然に繋げる */
.list-articles-wrap .article-item:first-child {
    border-top: none;
    border-radius: 0 0 6px 6px;
}

/* 最後の要素もマージンを持たせるように変更（不要なborder-bottom制御は削除） */
.list-articles-wrap .article-item:last-child {
    margin-bottom: 0;
}

.list-articles-wrap .article-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-article);
}

.article-item:hover {
    background: var(--bg-card-hover);
}

.article-rank {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 700;
    color: #888888;
    background: transparent;
    border-radius: 4px;
}

/* 上位3位のランクバッジ */
.article-item:nth-child(1) .article-rank {
    background: #daa520;
    color: #ffffff;
}

.article-item:nth-child(2) .article-rank {
    background: #a8a8a8;
    color: #ffffff;
}

.article-item:nth-child(3) .article-rank {
    background: #cd7f32;
    color: #ffffff;
}

.article-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    min-height: 22px;
}

.article-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    /* ランキングページと同じサイズに変更 */
    font-weight: 600;
    /* ランキングページと同じ太さに変更 */
    line-height: 1.5;
    display: block;
    /* 全文表示に変更（文字数制限を解除） */
    transition: color var(--transition);
}

.article-link:hover {
    color: var(--link);
}

.article-meta {
    display: none;
    /* 時間表示や古いメタ情報は非表示 */
}

.site-badge {
    display: inline-block;
    font-size: 0.6rem;
    color: var(--text-muted);
    background: none;
    padding: 0;
    border-radius: 0;
}

/* 新着一覧ページの記事日時 */
.list-articles-wrap .article-date {
    font-size: 0.7rem;
    color: #999;
    padding: 0;
}

/* ===========================
   ランキングリスト（ranking.php）
   =========================== */
/* ランキングページのラッパー（デザイン削除・透明化） */
.ranking-articles-wrap {
    background: transparent;
    border: none;
    border-radius: 0;
    margin-top: 16px;
}

/* グレー見出し（共通） */
.section-header {
    background-color: var(--section-header-bg);
    padding: 12px 16px;
    border-radius: 8px 8px 0 0;
    border-bottom: none;
    margin-bottom: 0;
}

.section-header h2 {
    font-size: 0.85rem;
    /* 見出しの文字を少し小さめに変更 */
    font-weight: 700;
    color: var(--section-header-text);
    margin: 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 見出しのアイコン設定 */
.header-icon {
    width: 18px;
    height: 18px;
    fill: var(--section-header-text);
    flex-shrink: 0;
}

.ranking-articles-wrap .ranking-list {
    list-style: none;
    counter-reset: ranking;
    margin: 0;
    padding: 0;
}

.ranking-articles-wrap .ranking-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    margin-bottom: 6px;
    box-shadow: var(--shadow-card);
    transition: background 0.1s, border-color 0.1s;
    counter-increment: ranking;
}

/* 見出しと合体する最初の要素は上のボーダーを消し、上部の角丸も消して自然に繋げる */
.ranking-articles-wrap .ranking-item:first-child {
    border-top: none;
    border-radius: 0 0 6px 6px;
}

.ranking-articles-wrap .ranking-item:last-child {
    margin-bottom: 0;
}

.ranking-articles-wrap .ranking-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-article);
}

.ranking-item::before {
    display: none;
}

.ranking-content {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* サイト名を右端に寄せるために間隔を最大化 */
    gap: 8px;
    min-height: 22px;
}

.ranking-link {
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.5;
    display: block;
    /* 全文表示に変更（list.phpと統一） */
    transition: color var(--transition);
}

.ranking-link:hover {
    color: var(--link);
}

.ranking-meta {
    display: none;
    /* 古いメタ情報は非表示 */
}

/* 行内に表示するサイト名用 */
.site-name-inline {
    font-size: 0.6em;
    /* サイズを0.6emに変更 */
    color: #666;
    /* #888 -> #666 に少し濃く */
    white-space: nowrap;
    flex-shrink: 0;
    text-align: right;
    /* 右寄せを明示（表示上はspace-betweenで右端に） */
}

/* 古いクリック数バッジとサイト名はそのまま残す（他で使われている可能性があるため） */
.click-count {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 500;
    color: #666666;
    /* #888888 -> #666666 */
    white-space: nowrap;
}

.site-name {
    font-size: 0.6rem;
    color: var(--text-muted);
}

/* ===========================
   空状態メッセージ
   =========================== */
.empty-message {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* ===========================
   カテゴリナビ（ranking.php）
   =========================== */
.category-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}

.category-nav a {
    display: inline-block;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    color: #666666;
    padding: 6px 18px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: transparent;
    transition: all var(--transition);
}

.category-nav a:hover {
    color: #333333;
    border-color: #999999;
}

.category-nav a.active {
    background: #333333;
    color: #ffffff;
    border-color: #333333;
}

/* ===========================
   サイト別セクション（sites.php）
   =========================== */
.site-section {
    margin-bottom: 24px;
}

.site-section-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    padding: 10px 16px;
    background: #f0f0f0;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* ===========================
   サイト別カードグリッド（index.php）
   =========================== */
.site-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 300px);
    gap: 20px;
    justify-content: flex-start;
}

/* カード本体 */
.site-card {
    background: var(--bg-card);
    border: none;
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.15);
    overflow: hidden;
    padding: 0;
}



/* カードヘッダー（サイト名） */
.site-card-header {
    background: var(--bg-card);
    padding: 16px 16px 12px;
    border: none;
    border-bottom: none;
    text-align: left;
    margin-bottom: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    min-height: auto;
}

.site-card-favicon {
    width: 20px;
    height: 20px;
    margin-right: 8px;
    border-radius: 2px;
}

.site-card-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
    /* 名前を伸ばしてボタンを右端へ */
}

/* メニューボタン */
.site-card-menu-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 2px;
    color: #777;
    /* #999->#777 色を少し濃くする */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.1s, color 0.1s;
}

.site-card-menu-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

/* ケバブメニュー ラッパー（position基準） */
.site-card-menu-wrap {
    position: relative;
    margin-left: 8px;
}

/* ケバブメニュー ドロップダウン */
.kebab-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 160px;
    background: var(--kebab-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    z-index: 50;
    overflow: hidden;
}

.kebab-dropdown.active {
    display: block;
}

.kebab-dropdown ul {
    list-style: none;
    margin: 0;
    padding: 4px 0;
}

.kebab-dropdown li {
    margin: 0;
}

.kebab-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s;
}

/* ケバブメニュー アイコン */
.kebab-icon {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #606060;
}

[data-theme="dark"] .kebab-icon {
    color: #aaa;
}

.kebab-item:hover {
    background: var(--kebab-hover-bg);
}

/* ケバブメニュー 区切り線 */
.kebab-separator {
    height: 1px;
    background: var(--kebab-separator);
    margin: 4px 0;
}

/* ケバブメニュー 無効状態 */
.kebab-item-disabled {
    color: #ccc !important;
    pointer-events: none;
    cursor: default;
}

/* サムネイル画像エリア */
.site-card-thumb {
    border: none;
    background: transparent;
    text-align: center;
    margin-bottom: 12px;
    padding: 0 12px;
    /* 左右に白いスペース（記事のパディングと合わせる） */
}

.site-card-thumb img {
    display: block;
    width: 100%;
    /* 親要素(padding考慮済)に合わせて100% */
    /* height: 63px; から site1.jpgの比率に変更 */
    aspect-ratio: 620 / 124;
    object-fit: cover;
    object-position: left center;
    margin: 0 auto;
    max-width: none;
    border-radius: 4px;
    /* サムネイル画像を角丸に */
    border: 1px solid var(--border-strong);
    /* 記事の枠線と同じ色に変更 (#e0e0e0->#d0d0d0) */
}

/* スマホ表示時の追加CSSエリア（今は不要なため空） */


/* カード内の記事ボディ */
.site-card-body {
    padding: 0 12px 16px;
}

/* 個別記事（枠付き・薄い文字） */
.site-card-article {
    border: 1px solid var(--border-article);
    border-bottom-color: var(--border-article-bottom);
    border-radius: 4px;
    margin-bottom: 5px;
    transition: background 0.1s;
    background: var(--article-bg);
    font-family: "Helvetica Neue", "ヒラギノ角ゴ ProN W3", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "メイリオ", "Meiryo", "Arial", sans-serif;
    font-size: 12px;
    color: var(--article-text);
    line-height: 1.25;
}

.site-card-article:last-child {
    margin-bottom: 0;
}

.site-card-article:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-article);
    border-bottom-color: var(--border-article-bottom);
}

.site-card-article a {
    display: block;
    height: 43px;
    box-sizing: border-box;
    padding: 5px;
    font-size: 12px;
    color: var(--article-text);
    text-decoration: none;
    line-height: 1.25;
    overflow: hidden;
}

.site-card-article a:hover {
    color: var(--article-text);
    /* ホバー時も文字色を維持 */
}

/* レスポンシブ: タブレット（2カラム） */
@media (max-width: 900px) {
    .site-card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}

/* レスポンシブ: スマホ（1カラム） */
@media (max-width: 600px) {
    .site-card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ===========================
   フッター（黒）
   =========================== */
.site-footer {
    background: var(--footer-bg);
    margin-top: auto;
    padding: 20px 0;
    text-align: center;
    color: var(--footer-text);
    font-size: 0.78rem;
}


/* ===========================
   レスポンシブ
   =========================== */
@media (max-width: 640px) {
    .tab-nav .container {
        gap: 8px;
    }

    .tab-nav a {
        padding: 8px 20px;
        font-size: 0.82rem;
    }

    .article-item,
    .ranking-item {
        padding: 12px 14px;
    }

    .article-rank,
    .ranking-item::before {
        width: 22px;
        height: 22px;
        font-size: 0.72rem;
    }

    .article-link,
    .ranking-link {
        font-size: 0.85rem;
    }

    /* list.php・ranking.phpの記事タイトルを全幅にしてサイト名を右下に配置 */
    .article-content,
    .ranking-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .article-content .article-link,
    .ranking-content .ranking-link {
        width: 100%;
    }

    .article-content .site-name-inline,
    .ranking-content .site-name-inline {
        align-self: flex-end;
        font-size: 10px;
        /* ブラウザ最小サイズ制限の基準値 */
        transform: scale(0.8);
        /* 基準値からさらに縮小（実質8px程度に） */
        transform-origin: right bottom;
    }
}

/* ===========================
   サイト専用ページ (site.php)
   =========================== */

/* パンくずリスト */
.breadcrumb {
    padding: 12px 0;
    font-size: 0.85rem;
    color: #999;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #333;
    text-decoration: underline;
}

/* サイト情報ヘッダー */
.site-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0 12px;
    margin-bottom: 16px;
}

.site-detail-favicon {
    border-radius: 4px;
}

.site-detail-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: #333;
    margin: 0;
}

/* 記事一覧 */
.site-detail-articles {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    overflow: hidden;
}

.site-detail-articles .site-card-article {
    border: none;
    margin: 0;
    padding: 0 0 1px;
    /* ドット線1px分の高さを全幅で確保 */
    border-radius: 0;
    position: relative;
}

/* ドット区切り線を擬似要素で描画（左右に余白を確保・絶対配置） */
.site-detail-articles .site-card-article::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    border-bottom: 1px dotted #ccc;
}

.site-detail-articles .site-card-article:last-child {
    border-bottom: none;
}

.site-detail-articles .site-card-article:last-child::after {
    display: none;
}

.site-detail-articles .site-card-article a {
    padding: 10px 12px 10px 22px;
    height: auto;
    -webkit-line-clamp: unset;
    line-clamp: unset;
}

/* 記事日時 */
.article-date {
    display: block;
    padding: 0 10px 6px 22px;
    font-size: 0.7rem;
    color: #999;
}

/* 戻るリンク */
.site-detail-back {
    padding: 20px 0;
    text-align: center;
}

.site-detail-back a {
    color: #666;
    text-decoration: none;
    font-size: 0.9rem;
}

.site-detail-back a:hover {
    color: #333;
    text-decoration: underline;
}

/* ===========================
   サイト非表示
   =========================== */
.site-hidden {
    display: none !important;
    /* Grid レイアウトから完全除外 */
}

/* ===========================
   非表示サイト管理モーダル
   =========================== */
.hidden-sites-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 200;
    justify-content: center;
    align-items: center;
}

.hidden-sites-overlay.active {
    display: flex;
}

.hidden-sites-modal {
    background: var(--modal-bg);
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 420px;
    max-height: 70vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hidden-sites-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--modal-border);
}

.hidden-sites-modal-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.hidden-sites-close-btn {
    background: none;
    border: none;
    font-size: 1.4rem;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    border-radius: 4px;
    transition: background 0.15s;
}

.hidden-sites-close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.hidden-sites-list {
    overflow-y: auto;
    padding: 8px 0;
}

.hidden-sites-empty {
    padding: 24px 20px;
    text-align: center;
    color: #999;
    font-size: 0.9rem;
}

.hidden-site-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    border-bottom: 1px solid var(--modal-item-border);
}

.hidden-site-item:last-child {
    border-bottom: none;
}

.hidden-site-name {
    font-size: 0.9rem;
    color: var(--text-primary);
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden-site-restore-btn {
    background: none;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: #555;
    cursor: pointer;
    white-space: nowrap;
    margin-left: 12px;
    transition: background 0.15s, color 0.15s;
}

.hidden-site-restore-btn:hover {
    background: #f5f5f5;
    color: #333;
    border-color: #bbb;
}

/* ===========================
   ページネーション
   =========================== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
    margin: 32px 0 16px;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
}

.pagination .dots {
    color: var(--text-muted);
}

/* ===========================
   スマホ向けUI調整（画面幅768px以下）
   =========================== */
@media (max-width: 768px) {

    /* 1. サイト名の大きさを少し小さく */
    .site-title {
        font-size: 1rem;
    }

    /* 2. ハンバーガーメニューの位置を右端に */
    .burger-menu-btn {
        margin-right: 0;
    }

    /* 3. ナビゲーションとコンテンツ部分の間の余白を縮小 */
    .category-bar {
        /* カテゴリバー（白帯）自体の余白を少し詰める */
        margin-bottom: 0px;
    }


    /* 4. スマホ表示時: 通常モードの記事文字色をくっきり濃い #333333 に切り替え */
    body:not(.dark-mode) {
        --article-text: #333333;
    }

    main.container {
        /* メインコンテンツ上部のマージンを縮小（デフォルトは24px） */
        margin-top: 0px;
    }
}

.pagination a {
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
}

.pagination a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination .current {
    background: var(--text-primary);
    color: var(--bg-card);
    border: 1px solid var(--text-primary);
    font-weight: 700;
}

/* ダークモードでのダークグレー対応は、変数の反転(bg-card/text-primary等)で自然に対応されるようにしました */

.pagination .next-link {
    gap: 4px;
}

.pagination .next-link svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* ===========================
   スワイプコンテナ（PC: クラス切替）
   =========================== */
.swipe-container {
    position: relative;
}

.swipe-page {
    display: none;
}

.swipe-page.swipe-page--active {
    display: block;
}

/* ===========================
   スケルトンUI（ローディング表示）
   =========================== */
.swipe-skeleton {
    padding: 0;
    min-height: 500px;
}

.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 16px;
    min-height: 220px;
}

.skeleton-header {
    width: 60%;
    height: 14px;
    background: var(--badge-bg);
    border-radius: 4px;
    margin-bottom: 12px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-thumb {
    width: 100%;
    height: 56px;
    background: var(--badge-bg);
    border-radius: 4px;
    margin-bottom: 12px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

.skeleton-line {
    width: 100%;
    height: 12px;
    background: var(--badge-bg);
    border-radius: 3px;
    margin-bottom: 8px;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

.skeleton-line--short {
    width: 70%;
}

@keyframes skeleton-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.4;
    }
}

/* スマホ用サイドバー（クローン挿入されたもの） */
.sidebar-mobile {
    width: 100% !important;
    margin-top: 16px;
}

/* ===========================
   スマホ: Scroll Snap 有効化
   =========================== */
@media (max-width: 768px) {

    /* ヘッダーの高さを縮小 */
    .site-header {
        padding: 7px 0;
    }

    /* サイト名を完全中央に（バーガーメニューの幅を無視） */
    .site-title {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        text-align: center;
        font-size: 15px !important;
        margin: 0;
        display: flex;
        align-items: center;
    }

    .site-logo {
        height: 18px;
        margin-top: 1px;
    }

    /* バーガーメニューを右端に維持 */
    .burger-menu-btn {
        margin-left: auto;
        margin-right: -15px;
    }

    /* フッターとの空白を統一 */
    main.container {
        margin-bottom: 16px;
    }

    .swipe-container {
        display: flex;
        overflow-x: hidden;
        overflow-y: hidden;
        /* 各ページが最も高いページに引き伸ばされるのを防止 */
        align-items: flex-start;
        /* スクロールバー非表示 */
        -ms-overflow-style: none;
        scrollbar-width: none;
        /* 縦方向への誤スクロールを抑制しつつ横スワイプをJSでハンドリング */
        touch-action: pan-y;
    }

    .swipe-container::-webkit-scrollbar {
        display: none;
    }

    .swipe-page {
        display: block !important;
        flex: 0 0 100%;
        width: 100%;
        min-width: 100%;
        box-sizing: border-box;
        padding: 0 4px 24px 4px;
    }

    .swipe-skeleton {
        min-height: 80dvh;
        min-height: 80vh;
    }

    /* スマホではPCサイドバーを非表示（クローンで各ページに挿入） */
    #sidebar-source {
        display: none;
    }

    /* サイドバー（モバイル版）のスタイル調整 */
    .sidebar-mobile {
        display: flex;
        flex-direction: column;
        gap: 16px;
        padding: 0;
    }

    /* layout-wrapper のPC用flex解除 */
    .layout-wrapper {
        display: block;
    }

    /* スケルトングリッドを1列に */
    .skeleton-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
}

/* ===========================
   ページトップへ戻るボタン
   =========================== */
.back-to-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 150;
    /* モーダル(200)やナビ(99)と競合しないレイヤー */

    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    cursor: pointer;

    /* 半透明背景 + 軽い影 */
    background: rgba(0, 0, 0, 0.55);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    /* アイコン配置 */
    display: flex;
    align-items: center;
    justify-content: center;

    /* 初期状態は非表示 */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);

    /* フェード + 浮き上がりアニメーション */
    transition:
        opacity 0.3s ease,
        visibility 0.3s ease,
        transform 0.3s ease,
        background 0.2s ease,
        box-shadow 0.2s ease;
}

/* 表示状態 */
.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* 上スクロール中は少し控えめに（UX改善） */
.back-to-top.is-faded {
    opacity: 0.45;
}

/* ホバー時 */
.back-to-top:hover {
    background: rgba(0, 0, 0, 0.72);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
    transform: translateY(-2px);
}

/* アクティブ時（押下フィードバック） */
.back-to-top:active {
    transform: translateY(0);
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.15);
}

/* フォーカス時（キーボード操作） */
.back-to-top:focus-visible {
    outline: 2px solid #4a6cf7;
    outline-offset: 3px;
}

/* 矢印アイコン */
.back-to-top__icon {
    width: 20px;
    height: 20px;
    fill: #ffffff;
    transition: transform 0.2s ease;
}

.back-to-top:hover .back-to-top__icon {
    transform: translateY(-1px);
}

/* ===========================
   ダークモード対応（トップボタン）
   =========================== */
body.dark-mode .back-to-top {
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

body.dark-mode .back-to-top:hover {
    background: rgba(255, 255, 255, 0.28);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}

body.dark-mode .back-to-top__icon {
    fill: #e0e0e0;
}

/* ===========================
   スマホ最適化（トップボタン）
   =========================== */
@media (max-width: 768px) {
    .back-to-top {
        /* タッチしやすいサイズ（44x44以上推奨） */
        width: 44px;
        height: 44px;
        bottom: 18px;
        right: 16px;
    }

    .back-to-top__icon {
        width: 18px;
        height: 18px;
    }
}

/* ===========================
   おすすめ商品ウィジェット
   =========================== */
.recommend-unit {
    width: 100%;
    max-width: 300px;
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg-card);
}

.recommend-unit__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
}

.recommend-unit__image-wrap {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
}

.recommend-unit__image {
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.recommend-unit__title {
    margin-top: 12px;
    font-size: 0.88rem;
    font-weight: 600;
    line-height: 1.45;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.recommend-unit__link:hover .recommend-unit__title {
    color: var(--link);
}

.recommend-unit__edition {
    margin-top: 4px;
    font-size: 0.80rem;
    color: var(--text-primary);
    text-align: center;
    width: 100%;
    transition: color 0.15s ease;
}

.recommend-unit__link:hover .recommend-unit__edition {
    color: var(--link);
}

/* PC表示時はインライン広告を非表示（外側のrecommend-widget-rowで表示） */
.recommend-widget-inline {
    display: none;
}

/* 広告ウィジェット横並びコンテナ（ranking.php / list.php 用） */
.recommend-widget-row {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ranking/listのウィジェットにindexと同じ枠デザインを適用し、3列に収める */
.recommend-widget-row .recommend-widget,
.recommend-widget-inline .recommend-widget,
.sidebar-mobile .recommend-widget {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.15);
    border: none;
    border-bottom: 1px solid var(--border-strong);
    box-sizing: border-box;
    width: calc((100% - 32px) / 3);
    max-width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* スマホ表示時のインライン広告とサイドバー広告の枠スタイルを2つ目の広告（幅300px）に統一する */
@media (max-width: 768px) {

    /* インライン広告（1つ目）とサイドバー広告（2つ目）の横幅・影・枠の付け方（CSS）を完全に統一する */
    .recommend-widget-inline .recommend-widget,
    .sidebar .recommend-widget,
    .sidebar-mobile .recommend-widget,
    .page-index .recommend-widget {
        width: 100% !important;
        max-width: 300px !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 24px !important;
        box-sizing: border-box !important;

        /* 枠のデザイン（影・角丸・下線・背景色）を統一 */
        box-shadow: 0 1px 2px rgba(26, 26, 26, 0.15) !important;
        border: none !important;
        border-bottom: 1px solid var(--border-strong) !important;
        border-radius: 12px !important;
        background-color: var(--bg-card) !important;
    }
}

/* スマホ表示時（おすすめウィジェット） */
@media (max-width: 768px) {
    .recommend-unit {
        margin: 0 auto;
    }

    .recommend-unit__edition {
        font-size: 0.78rem;
    }

    /* スマホ表示時はPC専用の広告ウィジェットを非表示 */
    .recommend-widget--pc-only {
        display: none;
    }

    /* スマホ表示時は外側の広告行を非表示（スワイプ内のインライン広告を使用） */
    .recommend-widget-row {
        display: none;
    }

    /* スマホ表示時はインライン広告を表示し、直下のランキング枠との間に余白を設ける */
    .recommend-widget-inline {
        display: block;
        margin-top: 16px;
        margin-bottom: 16px;
    }
}

/* ===========================
   index.php 専用スタイル
   =========================== */
.page-index .container {
    max-width: 1340px !important;
}

.page-index .site-header .container {
    padding-left: 40px;
}

.page-index .category-bar .container {
    padding-left: 30px;
}

.page-index .layout-wrapper {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    margin-top: 24px;
    margin-bottom: 24px;
}

.page-index .main-column {
    flex: 1;
    min-width: 0;
}

.page-index .sidebar {
    width: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* カードグリッド: 固定幅300pxでウィンドウ幅に応じて列数が自動調整（最大3列） */
.page-index .site-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 300px) !important;
    gap: 16px !important;
    justify-content: center;
    max-width: 948px;
    margin: 0 auto;
}

@media (max-width: 768px) {
    .page-index .category-bar .container {
        padding-left: 0 !important;
    }

    .page-index .layout-wrapper {
        display: block;
        margin-top: 16px;
        margin-bottom: 0;
    }

    .page-index .site-card-grid {
        gap: 10px !important;
        max-width: none;
    }

    .page-index .sidebar {
        width: 100%;
    }

    .page-index .pagination {
        display: none !important;
    }

    .page-index .recommend-widget {
        max-width: 300px;
        margin-left: auto !important;
        margin-right: auto !important;
    }
}

@media (max-width: 550px) {
    .page-index .site-card-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* サイドバーを先に落として3列を維持 */
@media (max-width: 1310px) {
    .page-index .layout-wrapper {
        flex-direction: column;
        align-items: center;
    }

    .page-index .sidebar {
        width: 100%;
        max-width: 948px;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .page-index .sidebar-widget {
        flex: 1;
        min-width: 300px;
    }

    .page-index .recommend-widget {
        flex: 0 0 auto;
        width: auto;
        align-self: flex-start;
    }
}

/* カードのデザイン調整 */
.site-card {
    border-radius: 12px;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.15);
    border: none;
    background: var(--bg-card);
}

.site-card-grid>.site-card:nth-child(3n) {
    border-right: none !important;
}

.site-card-header {
    border-bottom: none;
    padding: 16px 16px 12px;
    justify-content: flex-start;
    min-height: auto;
}

/* バナー領域プレースホルダー */
.placeholder-banner {
    background-color: var(--badge-bg);
    color: var(--text-muted);
    height: 63px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: bold;
    border: 1px solid var(--border-strong);
}

.site-card-thumb img {
    width: 100%;
    aspect-ratio: 620 / 124;
    object-fit: cover;
    object-position: left center;
    border-radius: 4px;
    border: 1px solid #d0d0d0;
}

/* サイドバーウィジェット */
.page-index .sidebar-widget {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.15);
    border: none;
}

.page-index .recommend-widget {
    background: var(--bg-card) !important;
    border-radius: 12px !important;
    padding: 24px !important;
    box-shadow: 0 1px 2px rgba(26, 26, 26, 0.15) !important;
    border: none !important;
    border-bottom: 1px solid var(--border-strong) !important;
}

.page-index .sidebar-title {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.page-index .sidebar-title::before {
    display: none;
}

/* カテゴリータグ */
.page-index .category-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.page-index .category-tag {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--badge-bg);
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid var(--border);
}

/* サイドバーランキング用 */
.page-index .ranking-mock-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 8px;
}

.page-index .ranking-mock-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-light);
    background: transparent;
    padding: 10px 4px;
    transition: background 0.1s;
}

.page-index .ranking-mock-item:last-child {
    border-bottom: none;
}

.page-index .ranking-mock-item:hover {
    background: var(--bg-card-hover);
}

.page-index .ranking-mock-item a {
    font-size: 0.85rem;
    color: var(--text-primary);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    padding-right: 12px;
}

.page-index .ranking-mock-item a:hover {
    color: var(--text-secondary);
    text-decoration: underline;
}

.page-index .ranking-mock-favicon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    flex-shrink: 0;
    object-fit: cover;
}

/* 広告プレースホルダー */
.page-index .recommend-placeholder {
    width: 100%;
    height: 250px;
    background: var(--badge-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 4px;
}

/* サイドバー「もっと見る」ボタン */
.page-index .sidebar-more-btn {
    font-size: 0.68rem;
    font-weight: 500;
    color: var(--text-primary);
    background: var(--bg-card);
    text-decoration: none;
    white-space: nowrap;
    padding: 3px 10px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: background 0.2s;
    margin-left: 5px;
    display: inline-flex;
    align-items: center;
}

.page-index .sidebar-more-btn:hover {
    background: var(--bg-card-hover);
}

/* サイドバーアイコン */
.page-index .sidebar-icon-crown {
    width: 22px;
    height: 22px;
    fill: #daa520;
    flex-shrink: 0;
}

.page-index .sidebar-icon-fire {
    width: 18px;
    height: 18px;
    fill: #f56565;
    flex-shrink: 0;
}

.page-index .sidebar-title-inner {
    display: flex;
    align-items: center;
    gap: 10px;
}

.page-index .sidebar-no-data {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ===========================
   ranking.php 専用スタイル
   =========================== */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.period-select {
    appearance: none;
    -webkit-appearance: none;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    padding: 5px 28px 5px 12px;
    font-size: 0.82rem;
    color: #333;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 10px 6px;
    outline: none;
    transition: border-color 0.2s;
}

.period-select:hover {
    border-color: #999;
}

.period-select:focus {
    border-color: #666;
}

/* RSSフィードからのハイライト表示 */
.ranking-item.highlighted {
    background: #e3f2fd;
    padding-left: 12px;
    border-radius: 6px;
    animation: highlight-fade 0.6s ease-in-out;
}

@keyframes highlight-fade {
    0% {
        background: #bbdefb;
    }

    100% {
        background: #e3f2fd;
    }
}

/* ===========================
   sitelist.php 専用スタイル
   =========================== */
.page-sitelist .container {
    max-width: 1344px !important;
}

.page-sitelist .site-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, 300px) !important;
    gap: 20px !important;
    justify-content: flex-start !important;
}

@media (max-width: 768px) {
    .page-sitelist .site-card-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
        margin-top: 16px;
    }

    .page-sitelist .pagination {
        display: none !important;
    }
}

@media (max-width: 1100px) {
    .page-sitelist .site-card-grid {
        justify-content: center !important;
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 550px) {
    .page-sitelist .site-card-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }
}

/* ===========================
   setting.php 専用スタイル
   =========================== */
.settings-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
}

.settings-section {
    padding: 16px 0;
}

.settings-section:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.settings-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section-title svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* テーマ切り替え行 */
.theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.theme-info {
    flex: 1;
}

.theme-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.theme-description {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* 以前のデザイン（旧バージョン版）へのリンクボタン */
.old-design-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.old-design-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--text-muted);
}

/* トグルスイッチ */
.toggle-switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.toggle-switch-icon {
    font-size: 1rem;
    line-height: 1;
}

.toggle-switch input[type="checkbox"],
.site-visibility-toggle {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 48px;
    height: 26px;
    background: #ccc;
    border-radius: 26px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked+.toggle-slider {
    background: #4a6cf7;
}

input[type="checkbox"]:checked+.toggle-slider::after {
    transform: translateX(22px);
}

/* 現在のテーマ表示 */
.theme-current {
    margin-top: 12px;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    background: var(--badge-bg);
    font-size: 0.8rem;
    color: var(--text-secondary);
    display: inline-block;
}

/* 戻るリンク（設定・ABOUT共通） */
.settings-back {
    padding: 24px 0;
    text-align: center;
}

.settings-back a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
}

.settings-back a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

/* サイト表示設定 */
.site-visibility-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.site-visibility-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 4px;
    border-bottom: 1px solid var(--border-light);
}

.site-visibility-item:last-child {
    border-bottom: none;
}

.site-visibility-info {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.site-visibility-favicon {
    width: 16px;
    height: 16px;
    border-radius: 2px;
    flex-shrink: 0;
}

.site-visibility-name {
    font-size: 0.88rem;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-visibility-name.is-hidden {
    color: var(--text-muted);
}

/* サイト用トグル（小型） */
.site-toggle-slider {
    position: relative;
    width: 40px;
    height: 22px;
    background: #ccc;
    border-radius: 22px;
    cursor: pointer;
    transition: background 0.3s ease;
    flex-shrink: 0;
}

.site-toggle-slider::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:checked+.site-toggle-slider {
    background: #4a6cf7;
}

input[type="checkbox"]:checked+.site-toggle-slider::after {
    transform: translateX(18px);
}

/* リセットボタン */
.reset-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    padding: 8px 18px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    background: var(--badge-bg);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.reset-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.reset-btn svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

.site-visibility-description {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

/* サイト表示設定 ページネーション */
.site-vis-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.site-vis-page-btn {
    min-width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 0.82rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    padding: 0 8px;
    text-decoration: none;
}

.site-vis-page-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.site-vis-page-btn.active {
    background: #4a6cf7;
    color: #fff;
    border-color: #4a6cf7;
    font-weight: 700;
}

.site-vis-page-btn:disabled {
    opacity: 0.4;
    cursor: default;
}

.site-vis-page-info {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

/* ===========================
   about.php 専用スタイル
   =========================== */
.about-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-top: 16px;
}

.about-section {
    padding: 16px 0;
}

.about-section:not(:last-child) {
    border-bottom: 1px solid var(--border-light);
}

.about-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.about-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
}