/* =========================
   Base
========================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body#index-page {
    margin: 0;
    background: #f5f7fb;
    color: #1f2937;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
    line-height: 1.8;
    margin-bottom: 40px;
}

#index-page a {
    color: #2563eb;
}

#index-page p {
    margin: 16px 0;
    font-size: 17px;
}

/* =========================
   Header
========================= */

#index-page header {
    background: linear-gradient(135deg, #d7ffd2, #ecfff3);
    border-bottom: 1px solid #c7eec3;
    padding: 34px 20px;
    margin-bottom: 32px;
}

#index-page h1 {
    max-width: 1100px;
    margin: 0 auto;
    color: #0f172a;
    font-size: 36px;
    line-height: 1.25;
    letter-spacing: -0.03em;
}

/* =========================
   Layout
========================= */

#index-page .content {
    display: flex;
    align-items: flex-start;
    gap: 28px;

    width: min(94%, 1240px);
    margin: 0 auto;

    /*
     * stickyを動作させるため、
     * overflow: hiddenやoverflow: autoを設定しない
     */
    overflow: visible;
}

#index-page main {
    flex: 1;
    min-width: 0;

    background: #ffffff;
    padding: 34px;
    border-radius: 18px;

    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.08);
}


#index-page .flex {
    display: flex;
    gap: 32px;
}



#index-page .flex {
    display: flex;
    gap: 28px;
}





/* =========================
   Note
========================= */

#index-page .note {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 14px;
}

/* =========================
   Headings
========================= */

#index-page h2 {
    margin-top: 56px;
    margin-bottom: 18px;
    padding-left: 14px;
    border-left: 6px solid #22c55e;
    color: #111827;
    font-size: 28px;
    line-height: 1.35;
}

#index-page h3 {
    margin-top: 30px;
    margin-bottom: 8px;
    color: #111827;
    font-size: 22px;
}

/* =========================
   Video
========================= */

#index-page .video {
    width: 70%;

    margin: 24px auto;
    aspect-ratio: 16 / 9;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
    background: #000;
}

#index-page iframe {
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================
   Table of Contents
========================= */

#index-page ol {
    margin: 22px 0;
    padding: 20px 24px 20px 44px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

#index-page li {
    margin-bottom: 10px;
    padding-bottom: 8px;
    font-size: 16px;
    border-bottom: 1px solid #e5e7eb;
}

#index-page li:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

#index-page .red {
    display: inline-block;
    margin-left: 10px;
    padding: 2px 8px;
    color: #b91c1c;
    background: #fee2e2;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

/* =========================
   Product / Amazon area
========================= */

#index-page .tools {
    margin: 26px 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
}

/* 商品カード */
#index-page .tool {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    padding: 22px;
    margin-bottom: 0;
    text-align: center;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

#index-page .tool:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 35px rgba(15, 23, 42, 0.14);
    border-color: #86efac;
}

#index-page .tool span {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #111827;
}

#index-page .tool img {
    width: 100%;
    max-width: 260px;
    height: 180px;
    object-fit: contain;
    margin: 18px auto;
    display: block;
}

/* 初心者向けStarter Kitを目立たせる */
#index-page .tool:last-child {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #fff7ed, #ffffff);
    border: 2px solid #fb923c;
    position: relative;
}

#index-page .tool:last-child::before {
    content: "初心者におすすめ";
    position: absolute;
    top: -14px;
    left: 22px;
    background: #f97316;
    color: white;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: bold;
}

/* =========================
   Amazon Button
========================= */

#index-page .button,
#index-page .tool a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    margin-top: 10px;
    padding: 12px 22px;
    border-radius: 999px;
    color: #ffffff;
    background: #ff8f33;
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.3;
    box-shadow: 0 8px 18px rgba(249, 115, 22, 0.28);
    transition: background-color 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
}

#index-page .button:hover,
#index-page .tool a.button:hover {
    background: #22c55e;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(34, 197, 94, 0.28);
}

#index-page .button:active,
#index-page .tool a.button:active {
    transform: translateY(0);
}

/* Starter Kitのボタンだけ少し目立たせる */
#index-page .tool:last-child .button {
    font-size: 18px;
    padding: 14px 28px;
    animation: softPulse 2.4s infinite;
}

@keyframes softPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0.35);
    }
    70% {
        box-shadow: 0 0 0 12px rgba(249, 115, 22, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(249, 115, 22, 0);
    }
}

/* =========================
   Code block
========================= */

#index-page .code {
    position: relative;
    margin: 24px 0;
    background: #0f172a;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

#index-page pre {
    margin: 0;
    padding: 56px 22px 22px;
    overflow-x: auto;
    max-height: 540px;
}

#index-page code {
    color: #e5e7eb;
    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.6;
}

#index-page #codeCopyBtn {
    position: absolute;
    top: 14px;
    right: 14px;
    border: none;
    background: #22c55e;
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 999px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

#index-page #codeCopyBtn:hover {
    background: #16a34a;
    transform: translateY(-1px);
}

/* =========================
   Lists / Wiring
========================= */

#index-page ul {
    margin: 20px 0;
    padding: 20px 24px 20px 44px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
}

#index-page ul li {
    border-bottom: none;
    margin-bottom: 8px;
}

/* =========================
   Images
========================= */

#index-page img {
    max-width: 100%;
}


#index-page .img_large {
    width: 80%;
    display: block;
    margin: 24px auto;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}
/* =========================
   Sticky Sidebar Table of Contents
========================= */

#index-page .sidebar {
    display: block;
    flex: 0 0 280px;
    width: 280px;

    /*
     * サイドバー本体を固定する
     */
    position: sticky;
    top: 20px;
    align-self: flex-start;

    /*
     * 画面より目次が長い場合だけ
     * サイドバー内をスクロールできるようにする
     */
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

#index-page .sidebar-toc {
    position: static;

    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 20px;

    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

#index-page .sidebar-toc-title {
    margin: 0 0 14px;
    padding-bottom: 10px;

    color: #111827;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.3;

    border-bottom: 2px solid #22c55e;
}

#index-page .sidebar-toc ul {
    margin: 0;
    padding: 0;

    list-style: none;
    background: transparent;
    border: none;
    border-radius: 0;
}

#index-page .sidebar-toc li {
    margin: 0 0 7px;
    padding: 0;
    border: none;
}

#index-page .sidebar-toc a {
    position: relative;
    display: block;

    padding: 10px 12px 10px 16px;
    border-radius: 10px;

    color: #475569;
    background: transparent;

    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;

    transform: scale(1);
    transform-origin: left center;

    transition:
        color 0.25s ease,
        background-color 0.25s ease,
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

#index-page .sidebar-toc a::before {
    content: "";

    position: absolute;
    top: 50%;
    left: 4px;

    width: 4px;
    height: 0;

    background: #ffffff;
    border-radius: 999px;

    transform: translateY(-50%);
    transition: height 0.25s ease;
}

#index-page .sidebar-toc a:hover {
    color: #15803d;
    background: #f0fdf4;
    transform: translateX(3px);
}

/* 現在読んでいる場所 */
#index-page .sidebar-toc a.active {
    color: #ffffff !important;
    background: #16a34a;

    font-weight: 800;

    transform: scale(1.045);

    box-shadow: 0 7px 18px rgba(22, 163, 74, 0.25);

    animation: activeTocLink 0.35s ease-out;
}

#index-page .sidebar-toc a.active::before {
    height: 60%;
}

@keyframes activeTocLink {
    0% {
        transform: scale(1);
    }

    60% {
        transform: scale(1.075);
    }

    100% {
        transform: scale(1.045);
    }
}

/* 目次リンクで移動したとき、見出し上部に余白を作る */
#index-page main h2[id] {
    scroll-margin-top: 30px;
}



/* サイドバー内のAmazonリンク */
#index-page .sidebar-product {
    margin-top: 20px;
    padding: 15px;

    text-align: center;

    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 12px;
}

#index-page .sidebar-product p {
    margin: 0 0 10px;
    color: #9a3412;
    font-size: 13px;
    font-weight: 700;
}

#index-page .sidebar-amazon-button {
    display: block;
    padding: 9px 12px;

    color: #ffffff;
    background: #f97316;
    border-radius: 999px;

    text-decoration: none;
    font-size: 13px;
    font-weight: 800;

    transition:
        background-color 0.2s ease,
        transform 0.2s ease;
}

#index-page .sidebar-amazon-button:hover {
    color: #ffffff;
    background: #ea580c;
    transform: translateY(-2px);
}

/* PCでは本文内の目次を非表示 */
#index-page .mobile-toc {
    display: none;
}

/* =========================
   Mobile
========================= */

@media (max-width: 768px) {
    #index-page header {
        padding: 26px 16px;
    }

    #index-page h1 {
        font-size: 28px;
    }

    #index-page main {
        padding: 22px 16px;
        border-radius: 14px;
    }

    #index-page h2 {
        font-size: 23px;
        margin-top: 44px;
    }

    #index-page .tools {
        grid-template-columns: 1fr;
    }

    #index-page .tool:last-child {
        grid-column: auto;
    }

    #index-page .tool img {
        height: 150px;
    }

    #index-page .button,
    #index-page .tool a.button {
        width: 100%;
        text-align: center;
    }

    #index-page .red {
        margin-left: 0;
        margin-top: 6px;
    }

    #index-page pre {
        max-height: 460px;
    }

    @media (max-width: 768px) {
    #index-page .content {
        width: min(94%, 760px);
    }

    #index-page .flex {
        display: block;
    }

    #index-page .sidebar {
        display: none;
    }

    #index-page .mobile-toc {
        display: block;
    }

    #index-page .mobile-toc ol {
        margin: 22px 0;
        padding: 20px 20px 20px 42px;

        background: #f8fafc;
        border: 1px solid #e5e7eb;
        border-radius: 14px;
    }

    #index-page .mobile-toc li {
        margin-bottom: 10px;
        padding-bottom: 8px;
    }

    #index-page .mobile-toc li:last-child {
        margin-bottom: 0;
        padding-bottom: 0;
    }

    #index-page .mobile-toc a {
        font-weight: 700;
        text-decoration: none;
    }
}
}