/* 全体の文字サイズと行間を調整 */
article {
    font-size: 18px;
    line-height: 1.8;
    max-width: 800px;
    color: #1a1a1a;
}

@media (min-width: 769px) {
    article {
        max-width: 1000px;
    }
}

/* リンク色をパープル系に統一 */
article a {
    color: #534AB7;
    text-decoration: none;
}
article a:hover {
    color: #3C3489;
    text-decoration: underline;
}

/* ページタイトル (h1) */
article h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111;
    margin: 0 0 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #EEEDFE;
    line-height: 1.4;
}

/* 見出し h2 */
article h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 2.5rem 0 1rem;
    padding-left: 0.75rem;
    border-left: 4px solid #534AB7;
}

/* 見出し h3 */
article h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 2rem 0 0.75rem;
    padding-left: 0.75rem;
    border-left: 3px solid #AFA9EC;
}

/* 見出し h4 */
article h4 {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    margin: 1.5rem 0 0.5rem;
}

/* 段落 */
article p {
    margin: 0 0 1.2rem;
}

/* 画像サイズが最大幅を超えなくする */
article img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    margin: 1rem 0;
}

/* GitHub風コードブロック */
article code {
    background-color: #f6f8fa;
    padding: 0.2em 0.4em;
    border-radius: 6px;
    font-size: 85%;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}
article pre {
    background-color: #f6f8fa;
    border: 1px solid #d1d5da;
    border-radius: 6px;
    padding: 16px;
    overflow-x: auto;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 14px;
    line-height: 1.5;
    color: #24292e;
    margin: 1em 0;
}
article pre code {
    background: none;
    padding: 0;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
    line-height: inherit;
}

/* GitHub風テーブル */
article table {
    width: 100%;
    border-collapse: collapse;
    border-spacing: 0;
    margin: 1.5em 0;
    font-size: 14px;
}
article table th,
article table td {
    border: 1px solid #d1d5da;
    padding: 8px 13px;
}
article table th {
    background-color: #f6f8fa;
    font-weight: 600;
}
article table tr {
    background-color: #fff;
}
article table tr:nth-child(even) {
    background-color: #f6f8fa;
}

/* テーブル内コード */
article table code {
    background-color: #e8edf3;
    color: #24292e;
    border-radius: 4px;
    padding: 0.2em 0.4em;
    font-size: 85%;
    font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace;
}

/* 引用 */
article blockquote {
    padding: 0.75em 1.25em;
    color: #555;
    border-left: 4px solid #AFA9EC;
    background-color: #f6f8fa;
    margin: 1.5em 0;
    font-size: 16px;
    border-radius: 0 6px 6px 0;
}

article blockquote p:last-child {
    margin-bottom: 0;
}

/* リスト */
article ul,
article ol {
    padding-left: 1.5em;
    margin: 0 0 1.2rem;
}
article li {
    margin-bottom: 0.4em;
}

/* 水平線 */
article hr {
    border: none;
    border-top: 1px solid #e5e7eb;
    margin: 2rem 0;
}

/* 数式のはみ出し対策 */
.MathJax_Display,
mjx-container {
    overflow-x: auto;
    max-width: 100%;
}

/* リンクコピーボタン */
article h2,
article h3,
article h4 {
    position: relative;
}
.copy-link {
    position: absolute;
    left: -1.7em;
    top: 0.2em;
    font-size: 0.7em;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #534AB7;
    opacity: 0.4;
    transition: opacity 0.2s;
}
.copy-link:hover {
    opacity: 1;
}