:root{
    --header_footer_bg: rgba(34, 77, 45, 0.55);
}


body {
    font-family: 'M PLUS Rounded 1c', 'Segoe UI', 'Meiryo', sans-serif;
    font-size: 18px;
    line-height: 1.7;
    background: url('../images/bg/bg_low.webp') center center / cover no-repeat fixed;
    color: #f8f6ff;
    min-height: 100vh;
    margin: 0;
    position: relative;
    overflow-x: hidden;
}


/* 木漏れ日と森のきらめき */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(circle at 20% 30%, #fff8 0 80px, transparent 120px),
        radial-gradient(circle at 80% 60%, #fff5 0 60px, transparent 120px),
        url('data:image/svg+xml;utf8,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><circle cx="10" cy="10" r="1.5" fill="white" opacity="0.5"/><circle cx="80" cy="30" r="1" fill="white" opacity="0.3"/><circle cx="50" cy="80" r="1.2" fill="white" opacity="0.4"/></svg>');
    background-repeat: no-repeat, no-repeat, repeat;
    opacity: 0.4;
    pointer-events: none;
}

header {
    position: relative;
    background: var(--header_footer_bg); 
    box-shadow: 0 2px 12px #0004;
    border-radius: 0;
    padding-top:32px;
    padding-bottom: 0;         /* 下余白をなくす */
    margin-bottom: 0;          /* 下マージンもなくす */
}

.img-box {
    width: 100%;
    text-align: center;
    
    margin-bottom: 0;          /* 下余白をなくす */
    position: relative;
}

.header-tei {
    width: 120px;
    position: absolute;
    left: 35vw;
    top: -20px;
    filter: drop-shadow(0 2px 8px #0008);
    animation: tei-float 2.5s infinite ease-in-out alternate;
}
.header-marisa {
    width: 120px;
    position: absolute;
    right: 35vw;
    top: -20px;
    filter: drop-shadow(0 2px 8px #0008);
    animation: marisa-float 2.5s infinite ease-in-out alternate;
}

@keyframes tei-float {
    0% { transform: translateY(0);}
    100% { transform: translateY(12px);}
}
@keyframes marisa-float {
    0% { transform:  translateY(12px);}
    100% { transform:  translateY(0);}
}

.header-title {
    width: 200px;
    max-width: 70vw;
    margin: 0 16px;
    display: inline-block;
    vertical-align: middle;
    filter: drop-shadow(0 2px 8px #0004);
}

.hamburger {
    display: none;
    background: none;
    border: none;
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 100;
    width: 40px;
    height: 40px;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}
.hamburger span {
    display: block;
    width: 28px;
    height: 4px;
    margin: 5px 0;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
    box-shadow: 0 1px 4px #0008;
}

/* ハンバーガーメニュー用オーバーレイ */
.menu-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(20, 24, 20, 0.7);
    z-index: 98;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}
.menu-overlay.active {
    display: block;
    opacity: 1;
    pointer-events: auto;
}

/* ナビゲーションの上下marginを調整 */
.mainlink {
    text-align: center;
    background: rgba(44, 80, 28, 0.5);
    margin-top: 8px;      
    margin-bottom: 0;
    padding: 0.5em 0;
    box-shadow: 0 1px 8px #0006;
    border: 2px solid #7ecb8f;
    backdrop-filter: blur(2px);
    position: relative;
    z-index: 20;
}

.mainlink a {
    color: #eaffee;
    text-decoration: none;
    margin: 0 12px;
    padding: 10px 0 10px 8px;
    font-size: 1.1em;
    display: inline-block;
    position: relative;
    transition: color 0.3s, text-shadow 0.3s;
    text-shadow: none;
    vertical-align: middle;
}
.mainlink a:hover {
    color: #fff7b2;
    text-shadow: none;
}
.nav-icon {
    width: 22px;
    height: 22px;
    vertical-align: middle;
    margin-right: 4px;
    filter: drop-shadow(0 1px 4px #0008);
}

.main-and-sidebar-wrapper {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    gap: 32px;
}

main {
    flex: 1 1 600px;
    width: 100%;
    width:90vw;
    max-width: 900px;
    margin: 30px auto 60px auto;
    padding: 24px 16px;
    background: rgba(44, 80, 28, 0.85);
    border-radius: 18px;
    box-shadow: 0 2px 16px #0006;
    border: 2px solid #7ecb8f;
    backdrop-filter: blur(2px);
    position: relative;
    overflow: hidden;
    min-width: 0;
}


.sidebar {
    width: 320px;
    max-width: 32vw;
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 32px;
    position: sticky;
    top: 30px;
    height: fit-content;
    z-index: 2;
}

.sidebar-section {
    background: rgba(44, 80, 28, 0.85);
    border-radius: 12px;
    box-shadow: 0 2px 8px #0005;
    padding: 16px 12px;
    margin-bottom: 0;
}

.sidebar-section h3 {
    font-size: 1.1em;
    margin-bottom: 10px;
    color: #eaffee;
    border-left: 4px solid #7ecb8f;
    padding-left: 8px;
}

.sidebar-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-section li {
    margin-bottom: 16px;
}

.sidebar-section li:last-child {
    margin-bottom: 0;
}

.sidebar-section a {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #eaffee;
    text-decoration: none;
    transition: color 0.2s;
}

.sidebar-section a:hover {
    color: #fff7b2;
}

.thumb-16x9 {
    width: 88px;
    aspect-ratio: 16/9;
    background: #222;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.thumb-16x9 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}



.magic-circle-bg {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 0;
    pointer-events: none;
}
.magic-circle {
    width: 120px;
    opacity: 0.18;
    filter: drop-shadow(0 0 16px #a8fffa);
}

main h2 {
    font-size: 1.4em;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    padding: 0.3em 0.7em;
    border-left: 5px solid #7ecb8f;
    background: rgba(164,224,139,0.08);
    color: #eaffee;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 1;
}
main h3{
    margin-left:1.1em;
    font-size:1.25em;
}
.section-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
    filter: drop-shadow(0 1px 4px #0008);
}

main p {
    margin-left:20px;
    margin-bottom: 1.5em;
    font-size: 1em;
    color: #eaffee;
    text-shadow: none;
    position: relative;
    z-index: 1;
}

.forest-items {
    display: flex;
    gap: 18px;
    margin: 18px 0 24px 0;
    align-items: flex-end;
    z-index: 1;
    position: relative;
}
.forest-mushroom {
    width: 38px;
    filter: drop-shadow(0 2px 8px #0008);
}
.forest-potion {
    width: 32px;
    filter: drop-shadow(0 2px 8px #0008);
}

footer {
    margin-top: auto;
    text-align: center;
    background: var(--header_footer_bg); 
    padding: 24px 0 16px 0;
    font-size: 1em;
    border-radius: 0 0 18px 18px;
    border-top: 1.5px solid #7ecb8f;
    box-shadow: 0 -2px 12px #0004;
    position: relative;
    overflow: hidden;
}
.footer-magic-circle {
    width: 80px;
    opacity: 0.22;
    position: absolute;
    left: 10vw;
    top: -30px;
    filter: drop-shadow(0 0 16px #a8fffa);
    pointer-events: none;
}
.footer-items {
    margin: 10px 0 0 0;
    display: flex;
    justify-content: center;
    gap: 18px;
}
.footer-mushroom {
    width: 28px;
    filter: drop-shadow(0 2px 8px #0008);
}
.footer-potion {
    width: 24px;
    filter: drop-shadow(0 2px 8px #0008);
}

footer a {
    color: #eaffee;
    text-decoration: none;
    margin: 0 8px;
    transition: color 0.3s;
}
footer a:hover {
    text-decoration: underline;
    color: #fff7b2;
}

.brs {
    display: none;
}

.link{
    color:#7881ff;
}

main img{
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: none;
    margin: 16px 0;
}



a {
    color: #7ecb8f;
    transition: color 0.2s;
}
a:hover {
    color: #fff7b2;
    text-decoration: underline;
}


/* --- VS Code風 codeブロック装飾・コピーボタン・直書きCSS統合 --- */
pre[class*="language-"] {
    background: #303030 !important;
    color: #d4d4d4 !important;
    border-radius: 12px;
    box-shadow: none;
    font-family: 'MS Gothic', 'ＭＳ ゴシック', 'MS PGothic', 'ＭＳ Ｐゴシック', 'Consolas', 'Menlo', 'Monaco', monospace;
    font-size: 15px;
    padding: 18px 18px 18px 18px;
    margin-bottom: 2em;
    margin-left: 0 !important;
    overflow: auto;
    border: 1px solid #333;
    position: relative;
}

/* コード本体 */
code, pre code {
    background: none !important;
    color: #fff !important;
    font-family: inherit;
    font-size: inherit;
    line-height: 1.6;
    letter-spacing: 0.01em;
}

/* Prism.jsのspan背景色リセット（演算子やキーワードの白背景対策） */
code[class*="language-"] span,
pre[class*="language-"] span {
    background: none !important;
    box-shadow: none !important;
}

/* スクロールバーもVSCode風に */
pre[class*="language-"]::-webkit-scrollbar {
    height: 10px;
    width: 10px;
    background: #232323;
}
pre[class*="language-"]::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 6px;
}
pre[class*="language-"]::-webkit-scrollbar-thumb:hover {
    background: #666;
}

/* コピーボタン VSCode風＋直書きCSS反映 */
.code-copy-btn {
    position: absolute;
    top: 14px;
    right: 18px;
    background: #2d2d2d;
    color: #d4d4d4;
    border: 1px solid #444;
    border-radius: 8px;
    padding: 0 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s, color 0.2s;
    font-size: 1em;
    z-index: 2;
}
.code-copy-btn:hover {
    background: #fff7b2;
    color: #234d2d;
}
.code-copy-btn img {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    filter: drop-shadow(0 1px 4px #0008);
}
.code-copy-btn.copied {
    background: #fff7b2;
    color: #234d2d;
}
.code-copy-btn.copied span {
    color: #234d2d;
}

/* 選択時の色もVSCode風に */
pre[class*="language-"] ::selection,
pre[class*="language-"]::selection,
code ::selection,
code::selection {
    background: #264f78;
    color: #fff;
}

/* Prism.jsのトークンの白い影を消す */
.token,
.token.operator,
.token.keyword,
.token.string,
.token.number,
.token.boolean,
.token.function,
.token.class-name,
.token.comment,
.token.punctuation,
.token.selector,
.token.property,
.token.tag,
.token.attr-name,
.token.attr-value,
.token.regex,
.token.important,
.token.entity,
.token.url,
.token.symbol,
.token.constant,
.token.variable,
.token.parameter,
.token.builtin,
.token.char,
.token.inserted,
.token.deleted,
.token.namespace,
.token.prolog,
.token.doctype,
.token.cdata {
    text-shadow: none !important;
}

/* レスポンシブ：横幅が足りない場合はサイドバーをmain下に移動し、目次は非表示 */
@media screen and (max-width: 1024px) {
    body {
        flex-direction: column;
        align-items: stretch;
    }
    .main-and-sidebar-wrapper {
        display: block !important;   /* ← 追加: flexを解除してblockに */
        flex-direction: unset !important;
        gap: 0 !important;
        align-items: unset !important;
        position: static !important;
        overflow: visible !important;
        width: 100%;
        max-width: 100vw;
    }
    main {
        margin: 30px auto 0 auto;
        width: 95vw;
        max-width: 98vw;
        position: static !important;
        z-index: auto !important;
    }
    .sidebar {
        /* スクロール追従を解除して従来通り下部表示 */
        position: static !important;
        top: unset !important;
        height: auto !important;
        width: 100%;
        max-width: 100vw;
        margin-top: 0;
        flex-direction: row;
        gap: 24px;
        justify-content: center;
        position: static !important;
        z-index: auto !important;
        display: block !important; /* ← 追加: flex解除 */
    }
    .sidebar-section.toc {
        display: none;
    }
    .sidebar-section.latest,
    .sidebar-section.recommend {
        flex: 1 1 0;
        min-width: 0;
        margin-bottom: 0;
    }
    /* キャラクターの位置調整 */
    .header-tei {
        left: 30vw;
    }
    .header-marisa {
        right: 30vw;
    }
}

/* --- レスポンシブ --- */
@media screen and (max-width: 680px) {
    
    main {
        width:95vw;
        max-width: 98vw;
        padding: 8px;
        margin-top: 10px;
        border-radius: 0;
        box-shadow: none;
    }
    main p {
        margin-left:0;
    }
    .img-box img.header-title {
        width: 50vw;
        min-width: 80px;
        margin: 16px auto 8px auto;
    }
    .mainlink {
        padding: 0;
        border-radius: 0;
        box-shadow: none;
        flex-direction: column;
        position: absolute;
        top: 70px;
        right: 0;
        left: 0;
        z-index: 99;
        transition: opacity 0.3s;
        opacity: 0;
        pointer-events: none;
        display: flex; 
    }
    .mainlink.open {
        opacity: 1;
        pointer-events: auto;
    }
    .mainlink a {
        display: block;
        margin: 0;
        padding: 16px 0 16px 12vw;
        border-bottom: 1px solid #7ecb8f;
        font-size: 1.1em;
        text-align: left;
    }
    .mainlink a:last-child {
        border-bottom: none;
    }
    .hamburger {
        display: flex;
    }
    .brs {
        display: inline;
    }
    header {
        position: relative;
    }
    .sidebar {
        flex-direction: column;
        gap: 16px;
    }
    .sidebar-section {
        padding: 10px 6px;
    }
    .thumb-16x9 {
        width: 100%;
        max-width: 100vw;
    }

    /* キャラクターの位置調整 */
    .header-tei {
        left: 13vw;
    }
    .header-marisa {
        right: 13vw;
    }

    pre[class*="language-"] {
        margin-left:0 !important;
        border-radius: 12px;
        box-shadow: none;
        background: #23272e !important;
        position: relative;
        padding: 18px 18px 18px 18px;
        overflow: auto;
        margin-bottom: 2em;
    }
}

@media screen and (max-width: 480px) {
    .img-box img.header-title {
        width: 40vw;
    }
    .header-tei, .header-marisa {
        width: 96px;
    }
    .footer-magic-circle {
        width: 48px;
        left: 2vw;
        top: -16px;
    }
    .footer-mushroom {
        width: 18px;
    }
    .footer-potion {
        width: 16px;
    }
}

/* 記事作成日時・更新日時 */
.page-date, .page-update-date {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-size: 0.98em;
    color: #b7e6c7;
    margin: 0 0 -1.5em 0;
    padding-right: 4px;
    font-weight: 500;
}



.license-box {
    border: 2px solid #7ecb8f;
    border-radius: 10px;
    background: rgba(164,224,139,0.08);
    padding: 1em 1.5em;
    margin: 1.5em 0;
    color: #eaffee;
    font-size: 1em;
}