/* ページ下部のシェアを非表示にする */
p.uk-margin-large-top.uk-text-bold,
div.share_button_wrapper.uk-flex.uk-flex-center.uk-flex-middle.uk-flex-space-between {
    display: none !important;
}

/* ページ名を非表示にする */
.uk-text-small.uk-text-right {
    display: none !important;
}

/* ページ全体に関する設定 */
body {
    background-color: #000000 !important; 
    font-size: 12px !important;
}

/* スマホ版の謎のコンテナ背景を黒くする */
.uk-container.sp {
    background-color: #000 !important;
}

footer {
    background-color: #000000 !important;
    color: #fff !important;
}

h2 {
    color: #fff !important;
}

::selection {
    background: #000 !important;
}

a {
    color: #B464FF !important;
}

/*テーブル*/
th.tablesorter-header {
    background-color: #B464FF !important;
    color: #fff !important;
}

tr {
    color: #fff !important;
}

/* メイン記事部分・サイドバーの色 (PC/スマホ共通) */
#main_content,
div.uk-width-2-3.main_content,
section#wiki_menu {
    background-color: #0A141E !important;
    color: #ffffff !important;
    font-size: 12px !important;
}

/* PC版サイドバーの背景色とボーダー (前回の抜け) */
.uk-notouch #wiki_menu {
    background-color: #0A141E !important;
    color: #ffffff !important;
    border: 1px solid #fff !important;
}

/* スマホ版のメインコンテンツ内の #wiki_menu には枠 */
.uk-touch .sp section#wiki_menu {
    border: 1px solid #fff !important;
}


/* === サイトタイトル (PC/スマホ) === */

/* PC版サイトタイトル (aタグを紫背景・黒文字に) */
.uk-notouch #site_header h1 a.uk-link-muted[href="/rkamens"] {
    color: #000000 !important;
    background-color: #B464FF !important;
    font-weight: bold !important;
    padding: 8px 12px !important;
    display: block !important;
    box-sizing: border-box !important;
}
/* PC版サイトタイトル (親h1の余白・下線を消す) */
.uk-notouch #site_header h1 {
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    margin-bottom: 4px !important;
    background-color: transparent !important;
}

/* スマホ版サイトタイトル (aタグを紫背景・黒文字に) */
.uk-touch header h1.uk-h3 a[href="/rkamens"] {
    color: #000000 !important;
    background-color: #B464FF !important; 
    font-weight: bold !important;
    padding: 8px 12px !important;
    display: block !important;
    box-sizing: border-box !important;
}
/* スマホ版サイトタイトル (親h1のスタイル) */
.uk-touch header h1.uk-h3 {
    background-color: #000000 !important;
    color: #000000 !important;
    font-weight: bold !important;
    padding: 0 !important;
    margin: 0 !important;
    margin-bottom: 4px !important;
    border: none !important;
}


/* === サイトタイトル以外の h1 (PC/スマホ共通スタイル) === */
/* PC版(左メニュー, トップページ) / スマホ版(トップページ, メニュー) */
.uk-notouch #wiki_menu h1,
.uk-notouch .main_content h1,
.uk-touch .sp > h1, 
.uk-touch .sp #main_content h1,
.uk-touch .sp #wiki_menu h1 {
    color: #ffffff !important;
    background-color: transparent !important;
    font-weight: bold !important;
    
    padding: 8px 8px !important; /* 基本のpadding */
    padding-bottom: 9px !important; /* 下線を引く領域(1px) + 本来のpadding-bottom(8px) */
    
    max-width: 100% !important;
    box-sizing: border-box !important;
    
    border-bottom: none !important; /* ★ 元のborderは削除 */
    position: relative !important; /* ★ 疑似要素の基準にするため追加 */

    margin-top: 20px !important;
    margin-bottom: 10px !important;
    margin-left: 0px !important;
}

/* ★【追記】h1の下線を疑似要素(::after)でpaddingの内側に描画する */
.uk-notouch #wiki_menu h1::after,
.uk-notouch .main_content h1::after,
.uk-touch .sp > h1::after,
.uk-touch .sp #main_content h1::after,
.uk-touch .sp #wiki_menu h1::after {
    content: "" !important;
    position: absolute !important;
    bottom: 8px !important;  /* padding-bottom 9px のうち、下から6pxの位置に線を引く */
    left: 8px !important;  /* padding-left: 12px に合わせる */
    right: 12px !important; /* padding-right: 12px に合わせる */
    height: 1px !important;
    background-color: #B464FF !important;
}

/* h1の直後のpタグの余白 */
#wiki_menu h1 + p,
#main_content h1 + p {
    margin-top: 4px !important;
}

/* PC版/スマホ版 の各セクション先頭のh1の余白だけ消す */
.uk-notouch #wiki_menu h1:first-of-type,
.uk-notouch .main_content h1:first-of-type,
.uk-touch .sp > h1:first-of-type,
.uk-touch .sp #main_content h1:first-of-type,
.uk-touch .sp #wiki_menu h1:first-of-type {
    margin-top: 0 !important;
}

/* スマホ版 メニュー/ページ一覧 ボタン */
.uk-grid.uk-grid-collapse.uk-grid-divider {
    background-color: #000000 !important;
    color: #ffffff !important;
}

.uk-grid.uk-grid-collapse.uk-grid-divider a.uk-button {
    color: #ffffff !important;
    background-color: #000000 !important;
}

p {
    margin-top: 0px !important;
    line-height: 1.6em !important; 
    margin-left: 8px !important;
}