@import url('https://fonts.googleapis.com/css2?family=Figtree:ital,wght@0,300..900;1,300..900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
    font-family: "Figtree", sans-serif;
    background-color: #f5f5f5;
    color: #111;
    line-height: 1.6;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.container {
    width: 100%;
    max-width: 836px;
    padding: 20px 10px 20px 10px;
}

.title-page {
    text-align: right;
    margin: 0 0;
}

.sub-title-page {
    text-align: right;
    margin: 0 0;
}

.title {
    font-size: 48px;
    font-weight: 500;
    color: #111;
    line-height: 1;
    padding: 0 0 0 0;
}

.book-title {
    font-family: "Figtree", sans-serif;
    font-size: 38px;
    font-weight: 400;
    color: #111;
    line-height: 1;
    padding: 0 0 4px 0;
}

.author {
    font-size: 28px;
    font-weight: 400;
    color: #111;
    line-height: 1.2;
    padding: 0 0 5px 0;
}

.author ul {
    list-style-type: none;
}

.author li {
    font-size: 22px;
    margin: 5px 0;
}

.author a {
    text-decoration: none;
    color: #008080;
}

.author a:hover {
    text-decoration: underline;
}

.publication-year {
    font-size: 17px;
    font-weight: 400;
    color: #333;
}

.publication-year ul {
    list-style-type: none;
}

.publication-year li {
    font-size: 17px;
    margin: 5px 0;
}

.publication-year a {
    text-decoration: none;
    color: #008080;
}

.publication-year a:hover {
    text-decoration: underline;
}

.table-of-contents {
    margin: 30px 0 40px 0;
}

.table-of-contents h2 {
    font-size: 24px;
    font-weight: 400;
    margin-bottom: 10px;
}

.table-of-contents ul {
    list-style-type: none;
}

.table-of-contents li {
    font-size: 17px;
    margin: 5px 0;
}

.table-of-contents a {
    text-decoration: none;
    color: #008080;
}

.table-of-contents a:hover {
    text-decoration: underline;
}

.chapter {
    margin-bottom: 40px;
}

.chapter h2 {
    font-size: 28px;
    font-weight: 400;
    margin-bottom: 20px;
    color: #333;
    line-height: 1.2;
    font-family: "Figtree", sans-serif;
}

.chapter p {
    font-size: 17px;
    margin-bottom: 20px;
}

.chapter ul {
    list-style-type: none;
}

.chapter li {
    font-size: 17px;
    margin: 5px 0;
}

.chapter a {
    text-decoration: none;
    color: #008080;
}

.chapter a:hover {
    text-decoration: underline;
}

.line {
    border-bottom: 1px solid #111;
    margin: 15px 0;
}

.icon {
    width: 70px;
}

.figure {
    width: 400px;
    height: auto;
}

.figure-more {
    width: 450px;
    height: auto;
}

.figure-more-more {
    width: 600px;
    height: auto;
}

.figure-more-more-more {
    width: 700px;
    height: auto;
}

.code-container {
    font-size: 14px;
    margin-top: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background-color: #eee;
    border-left: 5px solid #008080;
    font-family: "Ubuntu Mono", monospace;
    font-weight: 400;
    font-style: normal;
    white-space: pre-wrap;
}

.toggle-link {
    color: #008080;
    cursor: pointer;
    text-decoration: none;
}

.toggle-link:hover {
    text-decoration: underline;
}

header {
    background-color: #f5f5f5;
    color: white;
    padding: 10px 0 10px 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
    width: 100%;
}

header h1 {
    font-size: 1.2rem;
    margin: 0 0 0 0;
}

.search-container {
    flex: 1;
    display: flex;
    gap: 0.5rem;
    max-width: 400px;
}

.search-container input {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 20px;
    font-size: 1rem;
    }

.search-container button {
    padding: 0.5rem 0.8rem;
    border: none;
    background-color: #f5f5f5;
    color: #008080;
    font-weight: bold;
    border-radius: 20px;
    cursor: pointer;
    border: 1px solid #008080;
}

.search-container button:hover {
    background-color: #f5f5f5;
    border: 1px solid #00bbbb;
}

main {
    padding: 0;
    margin-top: 60px;
}

mark {
    background-color: yellow;
    font-weight: bold;
}

.hidden {
    display: none;
}

details {
    border: 1px solid #f5f5f5;
    padding: 0;
    border-radius: 5px;
    background-color: #f5f5f5;
}

details details {
    margin-left: 16px;
}

summary {
    cursor: pointer;
    color: #008080;
}

summary:hover {
    text-decoration: underline;
}

pre {
    background-color: #eee;
    padding: 10px;
    border-radius: 4px;
    overflow-x: auto;
    position: relative;
}

table {
    width: 50%;
    font-size: 15px;
    border-collapse: collapse;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

th, td {
    padding: 4px 12px;
    text-align: center;
}

th {
    background-color: #008080;
    color: #fff;
    font-weight: normal;
}

tr:nth-child(even) {
    background-color: #f9f9f9;
}

tr:hover {
    background-color: #f1f1f1;
}

td {
    border-bottom: 1px solid #ddd;
}

.chapter:target {
    padding-top: 100px;
    margin-top: -60px;
}

.copy-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #eee;
    color: #008080;
    border: none;
    padding: 6px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    z-index: 10;
}

.copy-button:hover {
    background-color: #ddd;
}

.copy-button svg {
    width: 16px;
    height: 16px;
    fill: #008080;
}

.copy-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 680px) {
    body {
        padding: 10px;
    }

    .book-title {
        font-size: 40px;
    }

    .author {
        font-size: 20px;
    }
    
    .publication-year {
        font-size: 14px;
    }

    .table-of-contents h2 {
        font-size: 18px;
    }
    
    .table-of-contents li {
        font-size: 16px;
    }

    .chapter h2 {
        font-size: 24px;
    }

    .chapter p {
        font-size: 16px;
    }
    
    .icon {
        width: 60px;
    }
    
    .figure, .figure-more, .figure-more-more, .figure-more-more-more {
        width: 100%;
        height: auto;
    }
    
    .code-container {
        font-size: 12px;
    }
    
    header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .search-container {
        width: 100%;
    }
    
    .search-container input, .search-container button {
        font-size: 0.55rem;
        padding: 0.5rem 0.7rem;
    }
    
    table {
        width: 100%;
    }
    
    .chapter:target {
        padding-top: 120px;
        margin-top: -60px;
    }
}