:root {
    --bg: #07101e;
    --panel: #0d1828;
    --panel2: #111f33;
    --text: #eaf2ff;
    --muted: #91a3bd;
    --line: #223149;
    --accent: #55e6a5;
    --accent2: #65a8ff;
    --warning: #ffcf5c;
    --danger: #ff6f7d;
    --sidebar: 310px;
    --radius: 18px
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: radial-gradient(circle at 75% 0, #102b3b 0, #07101e 32%, #050b14 100%);
    color: var(--text);
    font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.8
}

button,
input {
    font: inherit
}

a {
    color: inherit
}

.app-shell {
    display: grid;
    grid-template-columns: var(--sidebar) minmax(0, 1fr);
    min-height: 100vh
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--line);
    background: rgba(6, 14, 25, .88);
    backdrop-filter: blur(16px);
    padding: 24px 18px;
    overflow: auto;
    z-index: 20
}

.brand {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 20px
}

.brand .coin {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, #ffb43a, #ff7d2c);
    color: #fff;
    font-weight: 900;
    font-size: 21px;
    box-shadow: 0 8px 28px #ff8a2530
}

.brand strong {
    display: block;
    font-size: 15px
}

.brand small {
    display: block;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: .16em
}

.search-wrap input {
    width: 100%;
    background: #0a1423;
    border: 1px solid var(--line);
    color: var(--text);
    padding: 11px 13px;
    border-radius: 12px;
    outline: none
}

.search-wrap input:focus {
    border-color: var(--accent2)
}

#toc {
    margin: 18px 0
}

#toc a {
    display: block;
    text-decoration: none;
    color: var(--muted);
    padding: 9px 10px;
    border-radius: 10px;
    font-size: 13px;
    margin: 2px 0
}

#toc a:hover,
#toc a.active {
    background: #13233a;
    color: var(--text)
}

.progress-box {
    margin-top: 22px;
    border-top: 1px solid var(--line);
    padding-top: 18px
}

.sidebar-footer {
    margin-top: auto;
    padding: 24px 10px 0;
    font-size: 12px;
    color: var(--muted)
}

.progress-head {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--muted)
}

.progress {
    height: 7px;
    background: #17243a;
    border-radius: 10px;
    overflow: hidden;
    margin: 9px 0 12px
}

.progress i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    width: 0
}

.ghost {
    width: 100%;
    background: transparent;
    border: 1px solid var(--line);
    color: var(--muted);
    border-radius: 10px;
    padding: 8px;
    cursor: pointer
}

.topbar {
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    background: rgba(5, 11, 20, .72);
    backdrop-filter: blur(14px);
    z-index: 15;
    border-bottom: 1px solid #ffffff08
}

.topbar-title {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100% - 150px);
    overflow: hidden;
    color: var(--text);
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap
}

.icon-btn {
    border: 1px solid var(--line);
    background: var(--panel);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    cursor: pointer
}

#menuBtn {
    display: none
}

main {
    min-width: 0
}

.chapter {
    max-width: 920px;
    margin: 0 auto;
    padding: 24px 48px;
    border-bottom: 1px solid var(--line);
    scroll-margin-top: 60px
}

.hero {
    padding-top: 40px
}

.eyebrow,
.chapter-no {
    color: var(--accent);
    letter-spacing: .18em;
    font-size: 11px;
    font-weight: 800
}

.hero h1 {
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1.05;
    margin: 14px 0 26px;
    letter-spacing: -.04em
}

.hero h1 em {
    font-style: normal;
    color: transparent;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    background-clip: text
}

.hero>p,
.lead {
    font-size: 18px;
    color: #b7c6d9;
    max-width: 760px
}

.hero-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin: 34px 0
}

.hero-cards div {
    background: linear-gradient(145deg, #101d30, #0a1422);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 19px
}

.hero-cards b {
    font-size: 27px
}

.hero-cards span {
    display: block;
    color: var(--muted);
    font-size: 12px
}

.notice,
.callout,
.warning,
.term {
    padding: 18px 20px;
    border-radius: 14px;
    margin: 28px 0
}

.notice {
    background: #142116;
    border: 1px solid #2b5d40;
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: 12px
}

.notice b {
    color: var(--accent)
}

.notice span {
    font-size: 13px;
    color: #b8c8ba
}

.chapter h2 {
    font-size: clamp(30px, 4vw, 46px);
    line-height: 1.2;
    margin: 10px 0 20px;
    letter-spacing: -.03em
}

.chapter h3 {
    font-size: 20px;
    margin-top: 38px
}

.chapter h4 {
    font-size: 16px
}

.chapter p {
    color: #bbc7d8
}

.concept-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin: 32px 0
}

.concept-grid article,
.split article {
    background: linear-gradient(150deg, var(--panel2), #0b1524);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 22px
}

.concept-grid article>span {
    font-size: 11px;
    color: var(--accent2);
    font-weight: 800;
    letter-spacing: .08em
}

.concept-grid h3 {
    margin: 8px 0
}

.concept-grid p,
.split p {
    font-size: 14px;
    margin: 0
}

.table-wrap {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 14px;
    margin: 20px 0
}

table {
    border-collapse: collapse;
    width: 100%;
    min-width: 560px;
    background: #0c1727
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    text-align: left;
    font-size: 14px
}

thead th {
    color: var(--accent);
    font-size: 12px
}

.term {
    background: #0e1e2d;
    border-left: 3px solid var(--accent2)
}

.term b {
    color: #a9d0ff
}

.term p,
.callout p,
.warning p {
    margin: 4px 0 0;
    font-size: 14px
}

.chain-demo {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: auto;
    padding: 20px 0
}

.chain-demo div {
    min-width: 185px;
    background: #0f1d2f;
    border: 1px solid #2b486a;
    border-radius: 14px;
    padding: 16px;
    box-shadow: inset 0 0 0 1px #ffffff04
}

.chain-demo small,
.chain-demo b,
.chain-demo code {
    display: block
}

.chain-demo small {
    color: var(--muted)
}

.chain-demo code {
    font-size: 11px;
    color: var(--accent);
    margin-top: 10px
}

.chain-demo i {
    font-style: normal;
    color: var(--muted)
}

.callout {
    background: #102439;
    border: 1px solid #25527a
}

.callout b {
    color: #7fbcff
}

.flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin: 28px 0
}

.flow div {
    padding: 18px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px
}

.flow b,
.flow span {
    display: block
}

.flow span {
    font-size: 13px;
    color: var(--muted);
    margin-top: 5px
}

.key-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin: 28px 0
}

.key-card>div {
    padding: 22px;
    border: 1px solid #285073;
    background: #0c1b2a;
    border-radius: 16px
}

.key-card>.danger {
    border-color: #6e3440;
    background: #23141b
}

.key-card small,
.key-card b {
    display: block
}

.key-card small {
    font-size: 10px;
    color: var(--accent2)
}

.key-card .danger small {
    color: var(--danger)
}

.key-card p {
    font-size: 14px;
    margin-bottom: 0
}

.warning {
    background: #2a2110;
    border: 1px solid #6e5822
}

.warning b {
    color: var(--warning)
}

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

.codebox {
    background: #050a12;
    border: 1px solid var(--line);
    border-radius: 16px;
    margin: 26px 0;
    overflow: hidden
}

.dots {
    color: #6f7d90;
    border-bottom: 1px solid var(--line);
    padding: 10px 14px;
    font-size: 10px;
    letter-spacing: 5px
}

.codebox pre {
    padding: 18px;
    margin: 0;
    overflow: auto
}

.codebox code {
    color: #83e0b9
}

.checklist {
    padding: 0;
    list-style: none
}

.checklist li {
    padding: 17px 0 17px 38px;
    border-bottom: 1px solid var(--line);
    position: relative
}

.checklist li:before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 18px;
    color: var(--accent);
    font-weight: 900
}

.checklist b,
.checklist span {
    display: block
}

.checklist span {
    color: var(--muted);
    font-size: 13px
}

.risk-meter {
    display: grid;
    grid-template-columns: 100px 1fr 52px;
    gap: 12px;
    align-items: center;
    margin: 14px 0;
    font-size: 13px
}

.risk-meter div {
    height: 10px;
    border-radius: 10px;
    background: #18263b;
    overflow: hidden
}

.risk-meter i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--warning), var(--danger))
}

.risk-meter strong {
    color: var(--warning)
}

.steps {
    list-style: none;
    padding: 0;
    counter-reset: s
}

.steps li {
    counter-increment: s;
    display: grid;
    grid-template-columns: 42px 130px 1fr;
    align-items: center;
    gap: 14px;
    padding: 16px 0;
    border-bottom: 1px solid var(--line)
}

.steps li:before {
    content: counter(s);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: #163250;
    color: var(--accent2);
    font-weight: 800
}

.steps span {
    color: var(--muted);
    font-size: 14px
}

.quiz-item {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: 20px;
    margin: 14px 0
}

.quiz-item h3 {
    margin: 0 0 14px;
    font-size: 16px
}

.choice {
    display: block;
    padding: 10px 12px;
    border: 1px solid #263750;
    border-radius: 10px;
    margin: 8px 0;
    cursor: pointer;
    color: #c5d1df
}

.choice:has(input:checked) {
    border-color: var(--accent2);
    background: #102844
}

.choice input {
    margin-right: 8px
}

.primary {
    background: linear-gradient(90deg, #2ebf86, #438df0);
    border: 0;
    color: white;
    padding: 13px 22px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer
}

.score-box {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #2e7355;
    background: #10291f;
    border-radius: 14px
}

.glossary #glossaryGrid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px
}

.glossary-card {
    padding: 17px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 13px
}

.glossary-card b {
    display: block;
    color: #b8d7ff
}

.glossary-card span {
    color: var(--muted);
    font-size: 13px
}

footer {
    max-width: 920px;
    margin: auto;
    padding: 50px 48px 80px;
    color: var(--muted)
}

footer p {
    margin: 0;
    color: var(--text);
    font-weight: 700
}

body.light {
    --bg: #f6f8fb;
    --panel: #fff;
    --panel2: #f7f9fc;
    --text: #152033;
    --muted: #526176;
    --line: #dbe3ee;
    --accent: #047857;
    --accent2: #2563eb;
    --warning: #a16207;
    --danger: #be123c;
    background: #f7f9fc
}

.light .chapter p {
    color: #334155
}

.light .sidebar,
.light .topbar {
    background: #ffffffde
}

.light .topbar {
    border-bottom-color: var(--line)
}

.light #toc a:hover,
.light #toc a.active {
    background: #e8eef6
}

.light .progress,
.light .risk-meter div {
    background: #dfe7f1
}

.light .search-wrap input {
    background: #f7f9fc
}

.light .concept-grid article,
.light .split article,
.light .hero-cards div {
    background: #fff
}

.light .table-wrap table {
    background: #fff
}

.light .codebox {
    background: #111827
}

.light .codebox code {
    color: #8df0c5
}

.light .chain-demo div {
    background: #fff;
    border-color: #bfd2ea
}

.light .key-card>div {
    background: #f4f9ff;
    border-color: #a9c7e8
}

.light .key-card>.danger {
    background: #fff3f4;
    border-color: #e7a7b3
}

.light .notice {
    background: #eef9f2;
    border-color: #91c9a6
}

.light .notice span {
    color: #365747
}

.light .warning {
    background: #fff8e8;
    border-color: #dfb35b
}

.light .warning b {
    color: #854d0e
}

.light .callout {
    background: #eef5ff;
    border-color: #9abce8
}

.light .callout b,
.light .term b,
.light .glossary-card b {
    color: #1d4ed8
}

.light .term {
    background: #eef5ff;
    border-left-color: var(--accent2)
}

.light .choice {
    color: #334155;
    border-color: var(--line)
}

.light .choice:has(input:checked) {
    background: #eaf2ff
}

.light .score-box {
    background: #ecfdf5;
    border-color: #86cfae
}

.light .steps li:before {
    background: #e0ecff;
    color: #1d4ed8
}

.hidden-search {
    display: none !important
}

@media(max-width:900px) {
    .app-shell {
        display: block
    }

    .sidebar {
        position: fixed;
        left: 0;
        top: 0;
        transform: translateX(-100%);
        width: min(86vw, 320px);
        transition: .22s;
        box-shadow: 20px 0 60px #0008
    }

    .sidebar.open {
        transform: translateX(0)
    }

    #menuBtn {
        display: block
    }

    .chapter {
        padding: 58px 24px
    }

    .hero {
        padding-top: 70px
    }

    .concept-grid {
        grid-template-columns: 1fr
    }

    .glossary #glossaryGrid {
        grid-template-columns: 1fr
    }

    .hero-cards {
        grid-template-columns: repeat(3, 1fr)
    }

    footer {
        padding: 40px 24px 70px
    }
}

@media(max-width:580px) {
    .hero h1 {
        font-size: 42px
    }

    .hero-cards {
        grid-template-columns: 1fr
    }

    .flow,
    .key-card,
    .split {
        grid-template-columns: 1fr
    }

    .steps li {
        grid-template-columns: 38px 1fr
    }

    .steps span {
        grid-column: 2
    }

    .notice {
        grid-template-columns: 1fr
    }

    .chapter {
        padding-left: 18px;
        padding-right: 18px
    }

    .risk-meter {
        grid-template-columns: 82px 1fr 40px
    }
}


/* Chapter advertisements */
.chapter-ad {
    margin: 36px 0 4px;
    padding: 20px 0 0;
    border-top: 1px solid var(--border, #24324a);
    min-height: 90px;
    overflow: hidden
}

.chapter-ad .adsbygoogle {
    min-height: 90px
}

.adsbygoogle {
    margin-bottom: 24px;
}

@media (max-width:700px) {
    .chapter-ad {
        margin-top: 28px;
        padding-top: 16px
    }
}

/* 暗号資産の具体的な使い方 */
.usage-steps {
    list-style: none;
    margin: 22px 0 26px;
    padding: 0;
    display: grid;
    gap: 12px;
    counter-reset: usage
}

.usage-steps li {
    position: relative;
    padding: 18px 20px 16px 58px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card)
}

.usage-steps li::before {
    content: counter(usage);
    counter-increment: usage;
    position: absolute;
    left: 18px;
    top: 17px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: .85rem
}

.usage-steps li>b {
    display: block;
    margin-bottom: 5px;
    color: var(--text)
}

.usage-steps li p {
    margin: 0;
    color: var(--muted)
}

@media(max-width:640px) {
    .usage-steps li {
        padding: 16px 15px 15px 52px
    }

    .usage-steps li::before {
        left: 14px;
        top: 15px
    }
}