/*
Theme Name: VTuberスレまとめVIP
Theme URI: https://example.com/matome-vip
Author: Your Name
Description: ホロライブ・にじさんじ・ぶいすぽっ！など人気VTuberの掲示板スレッドを5ch完全準拠フォーマットで表示するVTuber専門まとめサイトテーマ。スレ型レス表示・自動取得・掲示板機能を内蔵し、有効化するだけで即サイトが完成します。
Version: 2.1.1
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: matome-vip
Tags: news, blog, entertainment, two-columns, right-sidebar, custom-colors, custom-menu, custom-logo, featured-images, post-formats, sticky-post, threaded-comments, translation-ready, full-width-template, block-styles
*/

/* =============================================
   リセット & ベース
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; scroll-behavior: smooth; }
body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", "MS PGothic", sans-serif;
    background: #f2f2f2;
    color: #222;
    line-height: 1.6;
    min-width: 320px;
}
a { color: #0044aa; text-decoration: none; }
a:hover { color: #cc0000; text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* =============================================
   カラー変数
   ============================================= */
:root {
    --red:        #cc0000;
    --red-dark:   #990000;
    --red-light:  #ffeeee;
    --blue:       #003399;
    --blue-mid:   #336699;
    --blue-light: #e8f0ff;
    --orange:     #ff6600;
    --yellow:     #ffcc00;
    --yellow-bg:  #fffbe6;
    --green:      #006600;
    --gray-bg:    #f2f2f2;
    --gray-mid:   #cccccc;
    --gray-dark:  #666666;
    --white:      #ffffff;
    --border:     #cccccc;
    --shadow:     rgba(0,0,0,0.08);
}

/* カテゴリカラー（VTuber事務所・グループ別） */
.cat-hololive    { background: #0a3d91; }
.cat-nijisanji   { background: #e4007f; }
.cat-vspo        { background: #00b3a0; }
.cat-indie       { background: #6a4caf; }
.cat-overseas    { background: #d4541e; }
.cat-stream      { background: #c0392b; }
.cat-event       { background: #e67e00; }
.cat-general     { background: #555555; }
.cat-default     { background: #555555; }

/* =============================================
   レイアウト
   ============================================= */
.site-container {
    max-width: 1060px;
    margin: 0 auto;
    padding: 0 8px;
}
.main-layout {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 10px 0 20px;
}
.content-main { flex: 1; min-width: 0; }
.sidebar { width: 220px; flex-shrink: 0; }

/* =============================================
   ヘッダー
   ============================================= */
#site-header {
    background: var(--red-dark);
    border-bottom: 3px solid var(--yellow);
}
.header-top-bar {
    background: #880000;
    padding: 3px 0;
    font-size: 11px;
    color: #ffaaaa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-top-bar a { color: #ffaaaa; }
.header-top-bar a:hover { color: #fff; text-decoration: none; }
.visitor-count { color: #ffcc00; font-weight: bold; }

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    gap: 12px;
}
.site-title a {
    font-size: 26px;
    font-weight: bold;
    color: #fff;
    text-shadow: 2px 2px 0 #660000;
    letter-spacing: 1px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
}
.site-title a:hover { color: #ffff99; }
.site-title .title-accent { color: #ffcc00; }
.site-description { color: #ffaaaa; font-size: 11px; margin-top: 2px; }

.header-search form {
    display: flex;
    gap: 0;
}
.header-search input[type="search"] {
    padding: 6px 10px;
    font-size: 13px;
    border: none;
    border-radius: 3px 0 0 3px;
    width: 200px;
    outline: none;
    font-family: inherit;
}
.header-search button {
    padding: 6px 12px;
    background: var(--orange);
    color: #fff;
    border: none;
    border-radius: 0 3px 3px 0;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    font-family: inherit;
}
.header-search button:hover { background: #cc5500; }

/* =============================================
   グローバルナビ
   ============================================= */
#global-nav {
    background: var(--red);
    border-bottom: 2px solid var(--red-dark);
}
#global-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
}
#global-nav ul li a {
    display: block;
    padding: 8px 13px;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    border-right: 1px solid #aa0000;
    text-decoration: none;
    transition: background 0.15s;
}
#global-nav ul li a:hover { background: var(--orange); color: #fff; }
#global-nav ul li.current-menu-item a { background: #aa0000; }

/* =============================================
   速報バー
   ============================================= */
.breaking-bar {
    background: #111;
    color: #fff;
    display: flex;
    align-items: center;
    font-size: 12px;
    overflow: hidden;
    border-bottom: 2px solid var(--red);
}
.breaking-label {
    background: var(--red);
    color: #fff;
    font-weight: bold;
    padding: 5px 10px;
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 11px;
    letter-spacing: 1px;
}
.breaking-text {
    padding: 5px 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.breaking-text a { color: #ffcc00; }
.breaking-text a:hover { color: #fff; }

/* =============================================
   トップ広告バナー
   ============================================= */
.ad-area {
    background: var(--yellow-bg);
    border: 2px solid var(--yellow);
    padding: 6px;
    margin: 6px 0;
    text-align: center;
}
.ad-label {
    font-size: 10px;
    color: #999;
    display: block;
    text-align: left;
    margin-bottom: 3px;
}
.ad-banner-row {
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 4px;
}
.ad-banner-item {
    flex: 1;
    min-width: 140px;
    max-width: 220px;
    background: var(--orange);
    color: #fff;
    padding: 8px 10px;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    cursor: pointer;
    border-radius: 2px;
    line-height: 1.4;
    text-decoration: none;
    display: block;
    transition: background 0.15s;
}
.ad-banner-item:hover { background: #cc5500; color: #fff; text-decoration: none; }
.ad-banner-item.blue { background: var(--blue-mid); }
.ad-banner-item.blue:hover { background: var(--blue); }
.ad-banner-item.green { background: var(--green); }
.ad-banner-item.green:hover { background: #004400; }
.ad-banner-item.red { background: var(--red); }
.ad-banner-item.red:hover { background: var(--red-dark); }

/* =============================================
   ピックアップ / 注目まとめ
   ============================================= */
.pickup-section {
    background: #fff;
    border: 2px solid var(--orange);
    margin-bottom: 8px;
}
.pickup-section .section-head {
    background: var(--orange);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.pickup-list { padding: 0; }
.pickup-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.1s;
}
.pickup-item:last-child { border-bottom: none; }
.pickup-item:hover { background: #fff5f5; }
.pickup-hot-badge {
    font-size: 10px;
    font-weight: bold;
    padding: 1px 5px;
    border-radius: 2px;
    color: #fff;
    flex-shrink: 0;
    white-space: nowrap;
}
.badge-hot { background: var(--red); }
.badge-new { background: var(--green); }
.badge-bomb { background: var(--orange); }
.badge-sad  { background: var(--blue-mid); }
.badge-lol  { background: #888; }
.pickup-item-title a { color: #0000cc; font-weight: bold; }
.pickup-item-title a:hover { color: var(--red); }

/* =============================================
   スレッド記事カード
   ============================================= */
.thread-card {
    background: #fff;
    border: 1px solid var(--border);
    margin-bottom: 6px;
    transition: border-color 0.15s;
}
.thread-card:hover { border-color: var(--red); }

.thread-card-header {
    background: #eeeeee;
    border-bottom: 1px solid var(--border);
    padding: 4px 10px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.thread-number {
    color: var(--red);
    font-weight: bold;
    font-size: 12px;
    min-width: 20px;
}
.thread-cat-badge {
    font-size: 11px;
    color: #fff;
    font-weight: bold;
    padding: 1px 7px;
    border-radius: 2px;
    white-space: nowrap;
    text-decoration: none;
}
.thread-cat-badge:hover { opacity: 0.85; color: #fff; text-decoration: none; }
.thread-title-link {
    font-size: 14px;
    font-weight: bold;
    color: #0000cc;
    flex: 1;
    min-width: 0;
    line-height: 1.4;
}
.thread-title-link:hover { color: var(--red); text-decoration: underline; }
.thread-badges { display: flex; gap: 3px; flex-shrink: 0; }
.badge-new-post, .badge-hot-post {
    font-size: 9px;
    font-weight: bold;
    padding: 1px 4px;
    color: #fff;
    vertical-align: middle;
}
.badge-new-post { background: var(--red); }
.badge-hot-post { background: var(--orange); }

.thread-meta {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 4px 10px;
    background: #f9f9f9;
    border-bottom: 1px solid #eee;
    font-size: 11px;
    color: var(--gray-dark);
    flex-wrap: wrap;
}
.thread-meta .res-count { color: var(--red); font-weight: bold; }
.thread-meta .star-rating { color: var(--orange); }

.thread-card-body { padding: 6px 10px 8px; }

.thread-comment {
    display: flex;
    gap: 8px;
    padding: 4px 0;
    border-bottom: 1px dashed #eee;
    font-size: 13px;
    line-height: 1.5;
}
.thread-comment:last-child { border-bottom: none; }
.thread-comment .c-num {
    color: var(--red);
    font-weight: bold;
    font-size: 11px;
    min-width: 32px;
    flex-shrink: 0;
}
.thread-comment .c-name {
    color: var(--green);
    font-size: 11px;
    min-width: 56px;
    flex-shrink: 0;
}
.thread-comment .c-body { color: #222; flex: 1; }
.thread-comment.best-res {
    background: var(--yellow-bg);
    border-left: 3px solid var(--orange);
    padding-left: 6px;
}
.thread-comment.best-res .c-body { color: #111; }

.thread-card-footer {
    padding: 5px 10px;
    background: #f5f5f5;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
}
.read-more-btn {
    font-size: 12px;
    color: #fff;
    background: var(--red);
    padding: 3px 12px;
    border-radius: 2px;
    text-decoration: none;
    font-weight: bold;
    transition: background 0.15s;
}
.read-more-btn:hover { background: var(--red-dark); color: #fff; text-decoration: none; }
.share-btns { display: flex; gap: 4px; }
.share-btn {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 2px;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}
.share-btn:hover { opacity: 0.85; color: #fff; text-decoration: none; }
.share-btn.x-btn    { background: #000; }
.share-btn.line-btn { background: #06c755; }
.share-btn.copy-btn { background: #888; cursor: pointer; border: none; font-family: inherit; }

/* =============================================
   記事本文（single.php用）
   ============================================= */
.entry-header { margin-bottom: 12px; }
.entry-cat-meta {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.entry-title {
    font-size: 20px;
    font-weight: bold;
    line-height: 1.45;
    color: #111;
    margin-bottom: 8px;
}
.entry-info {
    font-size: 11px;
    color: var(--gray-dark);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    border-bottom: 2px solid var(--red);
    padding-bottom: 6px;
}
.entry-content { padding: 12px 0; }
.entry-content p { margin-bottom: 12px; font-size: 14px; line-height: 1.75; }
.entry-content h2 {
    font-size: 16px;
    font-weight: bold;
    padding: 6px 10px;
    border-left: 4px solid var(--red);
    background: #f5f5f5;
    margin: 20px 0 10px;
}
.entry-content h3 {
    font-size: 14px;
    font-weight: bold;
    border-bottom: 2px solid var(--red);
    padding-bottom: 4px;
    margin: 16px 0 8px;
}

/* 引用コメントブロック */
.matome-comment-block {
    border: 1px solid var(--border);
    margin: 12px 0;
    background: #fff;
}
.matome-comment-block .block-header {
    background: #eeeeee;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--gray-dark);
    border-bottom: 1px solid var(--border);
    font-weight: bold;
}
.matome-comment-block .block-body { padding: 6px 10px; }
.matome-single-comment {
    display: flex;
    gap: 8px;
    padding: 5px 0;
    border-bottom: 1px dashed #eee;
    font-size: 13px;
    line-height: 1.55;
}
.matome-single-comment:last-child { border-bottom: none; }
.matome-single-comment .s-num { color: var(--red); font-weight: bold; font-size: 11px; min-width: 30px; flex-shrink: 0; }
.matome-single-comment .s-name { color: var(--green); font-size: 11px; min-width: 54px; flex-shrink: 0; }
.matome-single-comment .s-text { flex: 1; }
.matome-single-comment.highlight { background: var(--yellow-bg); border-left: 3px solid var(--orange); padding-left: 6px; }

/* =============================================
   広告 — 記事内インライン
   ============================================= */
.ad-inline {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow);
    padding: 8px;
    margin: 12px 0;
    text-align: center;
}
.ad-affiliate-block {
    border: 2px solid var(--red);
    background: #fff;
    padding: 10px;
    margin: 12px 0;
}
.ad-affiliate-block .ad-label { color: #aaa; margin-bottom: 6px; }
.affiliate-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 6px 0;
    border-bottom: 1px solid #eee;
}
.affiliate-item:last-child { border-bottom: none; }
.affiliate-thumb {
    width: 64px;
    height: 64px;
    object-fit: cover;
    flex-shrink: 0;
    background: #ddd;
}
.affiliate-info { flex: 1; min-width: 0; }
.affiliate-title { font-size: 13px; font-weight: bold; color: #0000cc; margin-bottom: 4px; line-height: 1.4; }
.affiliate-price { font-size: 14px; font-weight: bold; color: var(--red); margin-bottom: 4px; }
.affiliate-btn {
    display: inline-block;
    background: var(--orange);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    padding: 4px 14px;
    text-decoration: none;
    border-radius: 2px;
    transition: background 0.15s;
}
.affiliate-btn:hover { background: #cc5500; color: #fff; text-decoration: none; }
.affiliate-btn.amazon { background: #ff9900; color: #111; }
.affiliate-btn.amazon:hover { background: #e68900; }
.affiliate-btn.rakuten { background: #bf0000; }
.affiliate-btn.rakuten:hover { background: #990000; }

/* =============================================
   サイドバー
   ============================================= */
.sidebar-widget {
    background: #fff;
    border: 1px solid var(--border);
    margin-bottom: 10px;
    overflow: hidden;
}
.sidebar-widget .widget-title {
    background: var(--blue-mid);
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sidebar-widget .widget-title.red   { background: var(--red); }
.sidebar-widget .widget-title.green { background: var(--green); }
.sidebar-widget .widget-title.orange { background: var(--orange); }
.sidebar-widget .widget-title.dark  { background: #333; }
.sidebar-widget .widget-body { padding: 0; }

.sidebar-list-item {
    display: flex;
    gap: 6px;
    align-items: flex-start;
    padding: 6px 10px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.1s;
    text-decoration: none;
    color: inherit;
}
.sidebar-list-item:last-child { border-bottom: none; }
.sidebar-list-item:hover { background: #f0f0ff; text-decoration: none; }
.sidebar-rank { color: var(--red); font-weight: bold; min-width: 18px; font-size: 11px; flex-shrink: 0; margin-top: 1px; }
.sidebar-rank.rank-1 { color: #cc8800; }
.sidebar-rank.rank-2 { color: #888888; }
.sidebar-rank.rank-3 { color: #cc6600; }
.sidebar-item-title { color: #0000cc; line-height: 1.4; flex: 1; }
.sidebar-item-title:hover { color: var(--red); }
.sidebar-item-count { color: var(--gray-dark); font-size: 11px; white-space: nowrap; flex-shrink: 0; }

/* カテゴリ一覧サイドバー */
.sidebar-cat-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 10px;
    border-bottom: 1px solid #eee;
    font-size: 12px;
    transition: background 0.1s;
}
.sidebar-cat-item:last-child { border-bottom: none; }
.sidebar-cat-item:hover { background: #f5f5f5; }
.sidebar-cat-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.sidebar-cat-name { flex: 1; color: #0000cc; cursor: pointer; }
.sidebar-cat-name:hover { color: var(--red); }
.sidebar-cat-count { color: var(--gray-dark); font-size: 11px; }

/* サイドバー広告 */
.sidebar-ad {
    background: var(--yellow-bg);
    border: 1px solid var(--yellow);
    padding: 6px;
    margin-bottom: 10px;
}
.sidebar-ad-block {
    background: var(--orange);
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    text-align: center;
    padding: 10px 6px;
    margin: 4px 0;
    cursor: pointer;
    transition: background 0.15s;
}
.sidebar-ad-block:hover { background: #cc5500; }
.sidebar-ad-small { font-size: 10px; color: #999; text-align: center; margin-top: 3px; }

/* アフィリランキングサイドバー */
.sidebar-affiliate-item {
    display: flex;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid #eee;
    align-items: center;
    font-size: 12px;
}
.sidebar-affiliate-item:last-child { border-bottom: none; }
.sa-rank { font-size: 16px; font-weight: bold; color: var(--red); min-width: 24px; text-align: center; flex-shrink: 0; }
.sa-info { flex: 1; min-width: 0; }
.sa-name { font-weight: bold; color: #0000cc; margin-bottom: 2px; line-height: 1.3; }
.sa-name:hover { color: var(--red); }
.sa-desc { color: var(--gray-dark); font-size: 11px; }
.sa-btn {
    font-size: 11px;
    padding: 3px 8px;
    background: var(--orange);
    color: #fff;
    border-radius: 2px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}
.sa-btn:hover { background: #cc5500; color: #fff; text-decoration: none; }

/* =============================================
   ページネーション
   ============================================= */
.pagination {
    display: flex;
    gap: 3px;
    justify-content: center;
    margin: 16px 0;
    flex-wrap: wrap;
}
.pagination a,
.pagination span {
    display: inline-block;
    padding: 5px 11px;
    font-size: 13px;
    border: 1px solid var(--border);
    background: #fff;
    color: #0044aa;
    text-decoration: none;
    transition: background 0.1s;
}
.pagination a:hover { background: #eee; color: var(--red); text-decoration: none; }
.pagination .current {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    font-weight: bold;
}
.pagination .dots { color: var(--gray-dark); border: none; background: none; }

/* =============================================
   パンくずリスト
   ============================================= */
.breadcrumb {
    background: #fff;
    border: 1px solid var(--border);
    padding: 5px 10px;
    font-size: 11px;
    color: var(--gray-dark);
    margin-bottom: 6px;
}
.breadcrumb a { color: #0044aa; }
.breadcrumb a:hover { color: var(--red); }
.breadcrumb span::before { content: " ＞ "; color: #aaa; }

/* =============================================
   フッター広告
   ============================================= */
.footer-ad {
    background: var(--yellow-bg);
    border-top: 2px solid var(--yellow);
    padding: 8px;
    text-align: center;
    margin-top: 10px;
}
.footer-ad-links {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 6px;
}
.footer-ad-link {
    background: var(--yellow);
    border: 1px solid #ccaa00;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    transition: background 0.15s;
}
.footer-ad-link:hover { background: #eebb00; color: #000; text-decoration: none; }

/* =============================================
   フッター
   ============================================= */
#site-footer {
    background: var(--blue-mid);
    color: #fff;
    font-size: 12px;
    padding: 12px 0 8px;
    margin-top: 0;
}
.footer-inner {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 10px;
}
.footer-nav { display: flex; gap: 0; flex-wrap: wrap; }
.footer-nav a {
    color: #cce0ff;
    padding: 3px 10px;
    font-size: 12px;
    border-right: 1px solid #557799;
    text-decoration: none;
}
.footer-nav a:hover { color: #fff; text-decoration: underline; }
.footer-copyright { color: #aaccee; font-size: 11px; text-align: center; padding-top: 8px; border-top: 1px solid #557799; }
.footer-disclaimer {
    font-size: 10px;
    color: #aaccee;
    text-align: center;
    margin-top: 4px;
    line-height: 1.5;
}

/* =============================================
   バッジ・ラベル各種
   ============================================= */
.label-new   { background: var(--red);    color: #fff; font-size: 9px; font-weight: bold; padding: 1px 4px; vertical-align: middle; }
.label-hot   { background: var(--orange); color: #fff; font-size: 9px; font-weight: bold; padding: 1px 4px; vertical-align: middle; }
.label-pick  { background: var(--green);  color: #fff; font-size: 9px; font-weight: bold; padding: 1px 4px; vertical-align: middle; }

/* =============================================
   スクロールトップボタン
   ============================================= */
#scroll-top {
    position: fixed;
    bottom: 20px;
    right: 16px;
    background: var(--red);
    color: #fff;
    width: 40px;
    height: 40px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    border: none;
    z-index: 999;
    font-weight: bold;
}
#scroll-top.visible { opacity: 1; pointer-events: auto; }
#scroll-top:hover { background: var(--red-dark); }

/* =============================================
   レスポンシブ
   ============================================= */
@media (max-width: 768px) {
    .main-layout { flex-direction: column; }
    .sidebar { width: 100%; }
    .header-main { flex-direction: column; align-items: flex-start; }
    .header-search input[type="search"] { width: 160px; }
    .site-title a { font-size: 20px; }
    .ad-banner-row { flex-direction: column; }
    .thread-cat-badge { font-size: 10px; }
    .thread-title-link { font-size: 13px; }
}
@media (max-width: 480px) {
    body { font-size: 13px; }
    .thread-meta { gap: 8px; }
    .thread-comment .c-name { display: none; }
    .header-search { width: 100%; }
    .header-search input[type="search"] { flex: 1; width: auto; }
    .entry-title { font-size: 17px; }
}

/* =============================================
   WordPress標準クラス互換
   ============================================= */
.alignleft  { float: left;  margin: 0 16px 8px 0; }
.alignright { float: right; margin: 0 0 8px 16px; }
.aligncenter { display: block; margin: 12px auto; }
.alignwide  { width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption-text { font-size: 12px; color: var(--gray-dark); text-align: center; margin-top: 3px; }
.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* =============================================
   掲示板（BBS）2ch風スタイル
   ============================================= */
.bbs-mode .bbs-res-list { padding: 0 !important; }
.bbs-res {
    padding: 8px 10px;
    border-bottom: 1px solid #e8e8e8;
    list-style: none;
    font-size: 13px;
}
.bbs-res:target { background: #fffbe6; }
.bbs-res-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
    font-size: 12px;
}
.bbs-res-num { color: var(--green); font-weight: bold; }
.bbs-res-name { color: var(--green); font-weight: bold; }
.bbs-res-date { color: #777; }
.bbs-res-id { color: #999; font-size: 11px; }
.bbs-res-body {
    padding: 2px 0 2px 12px;
    line-height: 1.6;
    color: #222;
    white-space: pre-wrap;
    word-break: break-word;
}
.bbs-res-footer { margin-top: 4px; padding-left: 12px; }
.bbs-reply-btn {
    font-size: 11px;
    color: #0044aa;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
}
.bbs-reply-btn:hover { color: var(--red); }
.bbs-anchor { color: #0044aa; font-weight: bold; }
.bbs-anchor:hover { color: var(--red); }
.bbs-pending { color: #cc0000; font-size: 11px; font-style: italic; }

/* スレッド作成フォーム */
.bbs-new-thread-form {
    background: #fff;
    border: 2px solid var(--red);
    padding: 16px;
    margin: 12px 0;
    border-radius: 4px;
}
.bbs-new-thread-form h3 {
    margin: 0 0 12px;
    font-size: 15px;
    color: var(--red);
    border-bottom: 2px solid var(--red);
    padding-bottom: 6px;
}
.bbs-new-thread-form label { font-size: 13px; font-weight: bold; }
.bbs-new-thread-form input[type="text"],
.bbs-new-thread-form textarea {
    border: 1px solid #ccc;
    padding: 8px;
    font-family: inherit;
    font-size: 14px;
    margin-top: 4px;
    box-sizing: border-box;
}
.bbs-submit-btn {
    background: var(--red);
    color: #fff;
    border: none;
    padding: 10px 28px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    border-radius: 3px;
}
.bbs-submit-btn:hover { background: var(--red-dark); }
.bbs-note { font-size: 11px; color: #999; }
.bbs-msg-success {
    background: #e7f6e7;
    border: 1px solid #46b450;
    color: #2a6a2a;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 3px;
    font-size: 13px;
}
.bbs-msg-error {
    background: #fdecea;
    border: 1px solid #cc0000;
    color: #a00;
    padding: 10px 14px;
    margin-bottom: 12px;
    border-radius: 3px;
    font-size: 13px;
}
.bbs-board-list { margin: 12px 0; }

/* =============================================
   VTuberスレ型 — 5ch完全準拠レス表示
   ============================================= */
.thread-container {
    background: #efefef;
    border: 1px solid #ccc;
    padding: 0;
    margin: 8px 0;
}
.thread-head {
    background: #e8e8e8;
    border-bottom: 2px solid #889;
    padding: 8px 10px;
}
.thread-head-title {
    font-size: 16px;
    font-weight: bold;
    color: #c00;
    line-height: 1.4;
    margin: 0;
}
.thread-head-total {
    font-size: 12px;
    color: #666;
}
.thread-res-list {
    padding: 4px 0;
    background: #efefef;
}

/* 個々のレス（5ch準拠） */
.thread-res {
    padding: 6px 10px 10px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
}
.thread-res:target {
    background: #ffe;
    animation: res-flash 1.2s ease;
}
@keyframes res-flash { 0% { background: #ffd; } 100% { background: #ffe; } }

.res-meta {
    font-size: 12px;
    margin-bottom: 4px;
    color: #008000;
    word-break: break-all;
}
.res-num { color: #c00; font-weight: bold; }
.res-label { color: #444; }
.res-name { color: #008000; font-weight: bold; }
.res-name.sage { color: #008000; }
.res-name-link { color: #008000; }
.res-name-link:hover { color: #c00; }
.res-date { color: #444; margin-left: 4px; font-weight: normal; }
.res-id { color: #444; margin-left: 4px; }
.res-be { color: #888; margin-left: 4px; font-size: 11px; }

.res-body {
    padding: 2px 0 0 1em;
    color: #000;
    font-size: 14px;
    line-height: 1.7;
    word-wrap: break-word;
    overflow-wrap: break-word;
}
.res-anchor { color: #00f; text-decoration: underline; font-weight: bold; }
.res-anchor:hover { color: #c00; }
.res-img {
    max-width: 250px;
    max-height: 250px;
    margin: 4px 0;
    border: 1px solid #ccc;
    display: block;
}
.res-img-link:hover .res-img { opacity: 0.85; }
.res-yt-link {
    display: inline-block;
    background: #ff0000;
    color: #fff !important;
    padding: 2px 10px;
    border-radius: 3px;
    font-size: 13px;
    margin: 2px 0;
    text-decoration: none;
}
.res-yt-link:hover { background: #cc0000; color: #fff !important; }

/* レスポップアップ（アンカーホバー時に元レス表示） */
.res-popup {
    position: absolute;
    z-index: 100;
    background: #ffe;
    border: 1px solid #889;
    box-shadow: 2px 2px 6px rgba(0,0,0,0.3);
    padding: 6px 10px;
    max-width: 400px;
    font-size: 13px;
    line-height: 1.5;
    pointer-events: none;
}

/* トップ・一覧のスレリスト（ツイ速風のシンプルリスト） */
.thread-list-simple {
    background: #fff;
    border: 1px solid #ccc;
}
.thread-list-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
}
.thread-list-row:hover { background: #f7f7ff; }
.thread-list-rank {
    font-size: 13px;
    font-weight: bold;
    color: #c00;
    min-width: 28px;
    text-align: right;
    flex-shrink: 0;
}
.thread-list-main { flex: 1; min-width: 0; }
.thread-list-title {
    font-size: 14px;
    color: #00c;
    font-weight: bold;
    line-height: 1.4;
    display: block;
}
.thread-list-title:hover { color: #c00; }
.thread-list-preview {
    font-size: 12px;
    color: #666;
    margin-top: 3px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.thread-list-meta {
    font-size: 11px;
    color: #999;
    white-space: nowrap;
    flex-shrink: 0;
}
.thread-list-meta .res-c { color: #c00; font-weight: bold; }

@media (max-width: 480px) {
    .res-img { max-width: 160px; max-height: 160px; }
    .thread-head-title { font-size: 14px; }
    .res-body { font-size: 13px; }
}
