/* ================================
   ベーステーマ
================================ */
body.theme-dark {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    background: #121212;
    color: #e0e0e0;
}

/* ================================
   トップページ：ヒーロー
================================ */
.home-hero {
    background: radial-gradient(circle at top left, #4fc3f7 0, #1a1a1a 45%, #000 100%);
    color: #e0f7ff;
    padding: 80px 20px 60px;
    text-align: center;
    border-bottom: 1px solid #222;
}

.hero-inner {
    max-width: 900px;
    margin: 0 auto;
}

.home-hero h1 {
    margin: 0 0 15px;
    font-size: 40px;
    letter-spacing: 0.05em;
}

.home-hero p {
    font-size: 16px;
    opacity: 0.9;
}

.page-date {
    font-size: 12px;
    color: #b0bec5;
    margin-top: 8px;
}

/* ================================
   トップページ：ロゴ表示
================================ */
.logo-container {
    text-align: center;
    margin-bottom: 20px;
}

.site-logo {
    width: 120px !important;
    height: auto !important;
    display: inline-block;
    filter: drop-shadow(0 0 6px #4fc3f7);
    transition: transform 0.3s ease;
}

.site-logo:hover {
    transform: scale(1.05);
}

/* ================================
   トップページ：サイト紹介（intro）
================================ */
.site-intro {
    max-width: 900px;
    margin: 0 auto 40px;
    padding: 24px 28px;
    background: #181818;
    border: 1px solid #263238;
    border-radius: 10px;
    color: #cfd8dc;
    line-height: 1.8;
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.site-intro h2 {
    margin-top: 0;
    margin-bottom: 14px;
    color: #4fc3f7;
    font-size: 20px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.site-intro p {
    margin: 0 0 14px;
    font-size: 15px;
}

/* ================================
   トップページ：カードメニュー
================================ */
.home-main {
    padding: 40px 20px 60px;
}

.menu-section {
    max-width: 1100px;
    margin: 0 auto 36px;
}

.section-title {
    font-size: 20px;
    margin: 0 0 20px;
    color: #b0bec5;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

.menu-card {
    position: relative;
    display: block;
    background: #181818;
    padding: 22px 20px 20px;
    border-radius: 10px;
    text-decoration: none;
    color: #e0e0e0;
    box-shadow: 0 0 0 1px #222;
    transition: 0.2s ease;
    overflow: hidden;
}

.menu-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(79, 195, 247, 0.25), transparent 60%);
    opacity: 0;
    transition: 0.25s;
}

.menu-card:hover::before {
    opacity: 1;
}

.menu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.menu-card h3 {
    margin: 4px 0 6px;
    font-size: 20px;
    color: #e1f5fe;
}

.menu-card p {
    margin: 0;
    font-size: 14px;
    color: #b0bec5;
}

.card-tag {
    display: inline-block;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid #4fc3f7;
    color: #4fc3f7;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.home-tag {
    padding: 6px 10px;
}

/* ================================
   共通レイアウト（サイドバー付きページ）
================================ */
.wrapper {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
}

/* Sidebar（PC 版） */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background: #101010;
    color: #e0e0e0;
    height: 100vh;
    position: sticky;
    top: 0;
    border-right: 1px solid #222;
    box-shadow: 4px 0 12px rgba(0, 0, 0, 0.6);
    transition: transform 0.3s ease;
}

/* ロゴ */
.sidebar .logo {
    text-align: center;
    padding: 18px 16px;
    border-bottom: 1px solid #222;
}

.sidebar .logo img {
    width: 100px;
    border-radius: 6px;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 6px #4fc3f7);
    transition: transform 0.3s ease, filter 0.3s ease;
}

.sidebar .logo img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 0 10px #4fc3f7);
}

.sidebar .logo h2 {
    margin: 0;
    font-size: 18px;
    letter-spacing: 0.08em;
    color: #4fc3f7;
}

/* メニュー */
.sidebar ul {
    list-style: none;
    padding: 10px 0 0;
    margin: 0;
}

.sidebar ul li a {
    display: block;
    padding: 10px 18px;
    color: #b0bec5;
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: 0.2s;
}

.sidebar ul li a.active {
    background: #181818;
    color: #e1f5fe;
    border-left-color: #4fc3f7;
}

.sidebar ul li a:hover {
    background: #1f1f1f;
    color: #ffffff;
}

/* 折りたたみメニュー */
.submenu {
    display: none;
}

.collapsible.open .submenu {
    display: block;
}

/* ハンバーガー（PC では非表示） */
.hamburger {
    display: none;
    position: fixed;
    top: 14px;
    left: 14px;
    z-index: 1000;
    background: #101010;
    color: #e0e0e0;
    border: 1px solid #333;
    font-size: 22px;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
}

/* Main content */
.content {
    padding: 26px 26px 40px;
    flex-grow: 1;
}

/* ============================
   モバイル（幅900px以下）完全版
   ============================ */
@media (max-width: 900px) {

    /* ▼ サイドバー本体（スマホ時は fixed に切り替え） */
    .sidebar {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 280px !important;
        height: 100dvh !important;
        overflow-y: auto !important;
        padding-bottom: 140px !important;
        background: #101010 !important;
        transform: translateX(-280px) !important;
        transition: transform 0.3s ease !important;
        z-index: 999 !important;
    }

    /* ▼ ハンバーガーで開く（JS の .open と一致） */
    .sidebar.open {
        transform: translateX(0) !important;
    }

    /* ▼ ハンバーガー自体（スマホ時のみ表示） */
    .hamburger {
        display: block !important;
        position: fixed !important;
        top: 14px !important;
        left: 14px !important;
        z-index: 1000 !important;
        background: #101010;
        color: #e0e0e0;
        border: 1px solid #333;
        font-size: 22px;
        padding: 6px 10px;
        border-radius: 4px;
        cursor: pointer;
    }

    /* ▼ コンテンツの余白調整（サイドバーと重ならないように） */
    .content {
        padding: 70px 16px 32px !important;
    }

    .sidebar ul {
        height: auto !important;
        overflow: visible !important;
        position: static !important;
    }

    .sidebar.open {
        height: 100dvh !important;
    }

}

/* ================================
   パンくずリスト
================================ */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #90a4ae;
    margin-bottom: 14px;
}

.crumb-icon {
    font-size: 14px;
}

.breadcrumb a {
    color: #4fc3f7;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.crumb-sep {
    color: #546e7a;
}

.crumb-sep {
    margin: 0 6px;
    color: #444;
    font-size: 1.2rem;
    font-weight: bold;
    line-height: 1;
}

/* ================================
   ページヘッダ
================================ */
.hero {
    background: radial-gradient(circle at top left, rgba(79, 195, 247, 0.35), #1a1a1a 55%);
    color: #e1f5fe;
    padding: 24px 22px;
    border-radius: 10px;
    margin-bottom: 24px;
    border: 1px solid #263238;
}

.hero h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.hero p {
    margin: 0;
    font-size: 14px;
    color: #b0bec5;
}

/* ================================
   コードブロック（決定版）
================================ */
.code-block {
    position: relative;
    margin: 24px 0;
    background: #000000;
    border: 1px solid #37474f;
    border-radius: 6px;
    padding-top: 0; /* 上部にボタン用スペース */
}

/* タイトル行の線はいらないので無効化 */
.code-block::before {
    display: none;
}

/* コピーボタン（前のデザイン） */
.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #263238;
    color: #e0f7fa;
    border: 1px solid #4fc3f7;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: 0.2s;
    z-index: 10;
}

.copy-btn:hover {
    background: #37474f;
}

/* コード本体 */
.code-block pre {
    background: #000000;
    color: #e0e0e0;
    padding: 16px 20px;
    border-radius: 0 0 6px 6px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.6;
    margin: 0;
}

@media (max-width: 600px) {
    .code-block pre {
        padding: 16px 16px;
    }
}


    /* ================================
   リンクカード
================================ */
    .link-section {
        margin-bottom: 40px;
    }

    .link-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 24px;
        row-gap: 32px;
        padding: 4px 4px;
    }

    .link-card {
        background: #181818;
        border: 1px solid #263238;
        border-left: 4px solid #4fc3f7;
        border-radius: 8px;
        padding: 16px 18px;
        transition: box-shadow 0.3s ease, transform 0.2s ease;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .link-card:hover {
        box-shadow: 0 0 12px rgba(79, 195, 247, 0.5);
        transform: translateY(-4px);
    }

    .link-card a {
        font-size: 16px;
        color: #4fc3f7;
        text-decoration: none;
        font-weight: bold;
        margin-bottom: 8px;
    }

    .link-card a:hover {
        text-decoration: underline;
    }

    .link-card p {
        font-size: 13px;
        color: #cfd8dc;
        margin: 0;
    }

    /* ================================
   薄いテーブル
================================ */
    .thin-table {
        width: 100%;
        border-collapse: collapse;
        margin: 20px 0;
        font-size: 15px;
        background: rgba(255, 255, 255, 0.03);
        border-radius: 8px;
        overflow: hidden;
    }

    .thin-table th,
    .thin-table td {
        border: 1px solid rgba(255, 255, 255, 0.15);
        padding: 10px 12px;
        text-align: left;
    }

    .thin-table th {
        background: rgba(255, 255, 255, 0.08);
        font-weight: bold;
    }

    /* ================================
   サイトマップ（カード風）
================================ */
    .sitemap-section {
        margin-top: 40px;
    }

    .sitemap-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: 20px;
    }

    .sitemap-card {
        display: block;
        background: #2b2b2b;
        border: 1px solid #3a3a3a;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.4);
        text-decoration: none;
        color: #e0e0e0;
        transition: 0.2s;
    }

    .sitemap-card:hover {
        border-color: #8fe3c9;
        box-shadow: 0 0 12px rgba(143, 227, 201, 0.4);
    }

    .sitemap-card h3 {
        margin-top: 0;
        color: #8fe3c9;
        font-size: 18px;
    }

    .sitemap-card p {
        margin: 8px 0 0;
        font-size: 14px;
        color: #ccc;
    }

    /* ================================
   フッター
================================ */
    .site-footer {
        width: 100%;
        text-align: center;
        margin-top: 40px;
        padding: 20px 10px;
        background: #0d0d0d;
        border-top: 1px solid #263238;
        color: #90a4ae;
        font-size: 13px;
        letter-spacing: 0.05em;
    }

    .site-footer p {
        margin: 0 auto;
        text-align: center;
        width: 100%;
    }

    .site-footer a {
        color: #8fe3c9;
        text-decoration: none;
    }

    .site-footer a:hover {
        color: #b0f5df;
        text-decoration: underline;
    }

    /* --- 説明文 --- */
    .description {
        font-size: 15px;
        line-height: 1.6;
        margin-bottom: 10px;
    }

    /* ▼ 投稿カード（奮闘記ゆるトーク） */
    .post {
        background: #ffffff10;
        /* ダークテーマに合う半透明ホワイト */
        border: 1px solid #ffffff20;
        border-radius: 12px;
        padding: 16px 20px;
        margin: 20px 0;
        box-shadow: 0 4px 10px #00000030;
        backdrop-filter: blur(4px);
    }

    .post .name {
        font-weight: bold;
        color: #a8ffd4;
        /* Mint グリーン寄りの優しい色 */
        display: block;
        margin-bottom: 6px;
    }

    .post .body {
        margin: 10px 0;
        line-height: 1.7;
    }

    .post .date {
        font-size: 0.85em;
        color: #cccccc;
        display: block;
        text-align: right;
    }

    /* 章タイトル（h2）を Mint グリーンの縦ラインで装飾 */
    .content section h2 {
        border-left: 8px solid #98e0b5;
        /* Mint グリーン */
        padding-left: 14px;
        margin-top: 50px;
        margin-bottom: 20px;
        font-size: 1.7em;
        color: #e8fff2;
        /* ダークテーマで読みやすい薄ミント白 */
    }

    .page-purpose {
        font-size: 1.05rem;
        margin-bottom: 1.5em;
        color: #ddd;
        line-height: 1.7;
    }

    /* 外部リンクアイコンを自動付与 */
    a[target="_blank"]::after {
        content: "\f35d";
        /* Font Awesome: arrow-up-right-from-square */
        font-family: "Font Awesome 6 Free";
        font-weight: 900;
        margin-left: 6px;
        font-size: 0.85em;
        color: #666;
        vertical-align: middle;
    }

    /* --------------------------------------------------------------
   Update Note（更新情報）表示用スタイル
-------------------------------------------------------------- */
    .update-note {
        background: #2b2b2b;
        /* ダークテーマに合わせた背景 */
        border-left: 4px solid #4caf50;
        /* Mintカラーのアクセントライン */
        padding: 10px 15px;
        margin: 10px 0 20px 0;
        border-radius: 4px;
        color: #ddd;
        /* 読みやすい明度の文字色 */
        font-size: 0.95rem;
        line-height: 1.5;
    }

    /* ▼ サイドバー本体にスクロールを付ける＋目立たないスクロールバーにする */
    .sidebar {
        height: 100vh;
        overflow-y: auto;

        /* Firefox 用 */
        scrollbar-width: thin;
        scrollbar-color: #888 transparent;
    }

    /* Chrome / Edge 用 */
    .sidebar::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.25);
        border-radius: 3px;
    }

    .sidebar::-webkit-scrollbar-thumb:hover {
        background-color: rgba(0, 0, 0, 0.35);
    }

    /* ================================
   Homeアイコン（青い家）サイズ調整
================================ */
    .home-icon {
        width: 20px;
        height: 20px;
        object-fit: contain;
        vertical-align: middle;
        margin-right: 4px;
    }

    /* ================================
   上に戻るボタン
================================ */
    #backToTop {
        position: fixed;
        bottom: 30px;
        right: 30px;
        width: 50px;
        height: 50px;
        background: rgba(0, 0, 0, 0.4);
        border-radius: 50%;
        border: none;
        cursor: pointer;
        opacity: 0;
        visibility: hidden;
        transition: 0.3s ease;
        z-index: 999;
    }

    #backToTop.show {
        opacity: 1;
        visibility: visible;
    }

    #backToTop img {
        width: 32px;
        height: 32px;
        object-fit: contain;
        display: block;
        margin: auto;
        padding-top: 9px;
    }

    /* ================================
   トラブルシューティング（カード形式）
================================ */
    .trouble-cards {
        display: grid;
        gap: 20px;
        margin-top: 20px;
    }

    .trouble-card {
        background: var(--bg-secondary, #2b2b2b);
        padding: 20px;
        border-radius: 10px;
        border: 1px solid rgba(255, 255, 255, 0.1);
    }

    .trouble-card h3 {
        margin-top: 10px;
        font-size: 1.1rem;
        color: var(--accent, #8fda7f);
    }

    .trouble-card p {
        margin: 5px 0 10px;
    }

    /* スマホ対応（1列） */
    @media (max-width: 768px) {
        .trouble-cards {
            grid-template-columns: 1fr;
        }
    }

    /* PC対応（2列） */
    @media (min-width: 769px) {
        .trouble-cards {
            grid-template-columns: 1fr 1fr;
        }
    }

    /* 目次リンク（未クリック） */
    .toc a {
        color: #7fbfff;
        text-decoration: none;
    }

    /* ホバー時 */
    .toc a:hover {
        color: #b3d4ff;
    }

    /* クリック済み（Mint の緑寄りの青） */
    .toc a:visited {
        color: #6fc8c0 !important;
    }

    .sidebar {
        height: 100vh;
        overflow-y: auto;
    }

    /* 通常のリンクも目次と同じ色に統一 */
.content a {
    color: #7fbfff;
    text-decoration: none;
}

.content a:hover {
    color: #b3d4ff;
}

.content a:visited {
    color: #6fc8c0;
}

/* 通常のリンクも目次と同じ色に統一 */
.content a,
.home-main a,
.site-intro a {
    color: #7fbfff;
    text-decoration: none;
}

.content a:hover,
.home-main a:hover,
.site-intro a:hover {
    color: #b3d4ff;
}

.content a:visited,
.home-main a:visited,
.site-intro a:visited {
    color: #6fc8c0;
}

/* ▼ コード前後の説明をコードに寄せる（全ページ共通） */
.code-block {
    margin-top: 6px;      /* 見出しとの距離を縮める */
    margin-bottom: 4px;   /* 説明文との距離を縮める */
}

.code-desc {
    margin-top: -4px;     /* コードとの距離をさらに縮める */
    margin-bottom: 14px;  /* 次の見出しとは少し離す */
    font-size: 0.9em;
    color: #ccc;
}

