:root {
    --main-black: #222;
    --main-blue: #020247;
    --accent-red: #a50000;
    --bg-white: #ffffff;
    --light-gray: #f0f4f8;
}

body {
    font-family: 'Times New Roman', 'Hiragino Mincho ProN', serif;
    line-height: 1.7;
    color: var(--main-black);
    max-width: 850px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--bg-white);
}

header {
    top: 0;
    background-color: #ffffff;
    border-bottom: 2px solid var(--main-black);
    margin-bottom: 30px;
    padding-bottom: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

header h1 {
    margin-bottom: 10px;
}

h1 a {
    text-decoration: none;
    color: var(--main-black);
}
h2 a {
    text-decoration: none;
    color: var(--main-black);
}
/* ナビゲーション */
nav ul { 
    list-style: none; 
    padding: 0; 
    display: flex; 
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

nav a { 
    text-decoration: none; 
    color: var(--main-blue); 
    font-weight: bold;
}

nav a.active {
    color: var(--accent-red);
    border-bottom: 2px solid var(--accent-red);
}
/* コンテンツ */
h2 { 
    border-bottom: 1px solid var(--main-blue);
    color: var(--main-blue);
    padding-bottom: 5px;
    margin-top: 40px;
}

.card { 
    background: #ffffff; 
    padding: 20px; 
    border: 1px solid #d1d9e0;
    border-radius: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 25px;
    border-left: 5px solid var(--main-blue);
}

@media (max-width: 600px) {
    nav ul {
        gap: 12px;
    }
}

/* ==========================================================================
   数学書読書記録用（.math-article 内限定スタイル）
   ========================================================================== */

/* 記事全体のコンテナ */
.math-article {
    margin-top: 20px;
    margin-bottom: 60px;
}

/* 読書記録内のH1（本のタイトル） */
.math-article h1.book-title {
    font-size: 1.8rem;
    color: var(--main-black);
    text-align: left; /* 中央寄せにせず、論文のように左寄せに */
    margin-top: 10px;
    margin-bottom: 5px;
}

/* 投稿日などのメタ情報 */
.math-article .meta-info {
    font-size: 0.9rem;
    color: #666666;
    margin-bottom: 30px;
}

/* 読書記録内のH2（書籍情報、章ごとの見出しなど） */
/* 既存のh2の「下線・ネイビー」を継承しつつ、マージンを微調整 */
.math-article h2 {
    margin-top: 45px;
    margin-bottom: 15px;
}

/* 読書記録内のH3（第1章、第2章など） */
.math-article h3 {
    font-size: 1.2rem;
    color: var(--main-black);
    margin-top: 30px;
    margin-bottom: 10px;
    padding-left: 8px;
    border-left: 3px solid var(--main-blue); /* 控えめなアクセント線 */
}

/* 読書記録内のH4（学習メモなど） */
.math-article h4 {
    font-size: 1.05rem;
    color: var(--main-black);
    margin-top: 15px;
    margin-bottom: 5px;
}

/* 箇条書き（基本データやメモ）の調整 */
.math-article ul {
    padding-left: 20px;
    margin-top: 8px;
    margin-bottom: 15px;
}

.math-article li {
    margin-bottom: 6px;
}

/* 概要などの段落テキスト */
.math-article p {
    margin-top: 0;
    margin-bottom: 15px;
    text-align: justify; /* 日本語の端を綺麗に揃える */
}

/* リンクの色を既存のメインブルーに合わせる */
.math-article a {
    color: var(--main-blue);
}
.math-article a:hover {
    text-decoration: underline;
}

/* ページ下部の戻るリンク */
.math-article .back-footer {
    margin-top: 60px;
    padding-top: 15px;
    border-top: 1px dashed #d1d9e0;
}
