/* ========================================
   共通スタイル - ココメモ
   ======================================== */

/* リセット・基本設定 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, Arial, sans-serif;
    line-height: 1.8;
    color: #333;
    background: #f8f9fa;
}

/* コンテナ */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* メインコンテンツ */
main {
    min-height: calc(100vh - 200px);
}

.content {
    background: white;
    margin: 40px auto;
    padding: 60px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    animation: fadeIn 0.6s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 見出し */
h1 {
    font-size: 32px;
    margin-bottom: 10px;
    color: #1976d2;
    line-height: 1.4;
}

.last-updated {
    color: #666;
    margin-bottom: 40px;
    font-size: 14px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e0e0e0;
}

h2 {
    font-size: 24px;
    margin-top: 40px;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #2196F3;
    padding-bottom: 10px;
    scroll-margin-top: 80px;
}

h3 {
    font-size: 20px;
    margin-top: 30px;
    margin-bottom: 15px;
    color: #555;
    font-weight: 600;
}

/* テキスト */
p {
    margin-bottom: 20px;
    color: #555;
}

ul, ol {
    margin-left: 30px;
    margin-bottom: 20px;
}

li {
    margin-bottom: 10px;
    color: #555;
}

strong {
    color: #333;
    font-weight: 600;
}

/* リンク */
a {
    color: #2196F3;
    transition: color 0.2s;
}

a:hover {
    color: #1565c0;
}

a:focus {
    outline: 2px solid #2196F3;
    outline-offset: 2px;
}

/* ハイライトボックス */
.highlight {
    background: #fff3cd;
    padding: 20px;
    border-left: 4px solid #ffc107;
    margin: 20px 0;
    border-radius: 4px;
}

.highlight strong {
    display: block;
    margin-bottom: 8px;
    color: #856404;
}

.highlight ul {
    margin-top: 10px;
}

/* 目次 */
.toc {
    background: #f8f9fa;
    padding: 24px;
    border-radius: 8px;
    margin-bottom: 40px;
    border: 1px solid #e0e0e0;
}

.toc h2 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 16px;
    border-bottom: none;
    color: #1976d2;
}

.toc ul {
    list-style: none;
    margin-left: 0;
    margin-bottom: 0;
}

.toc > ul > li {
    margin-bottom: 8px;
}

.toc a {
    text-decoration: none;
    color: #555;
    display: block;
    padding: 4px 0;
    transition: all 0.2s;
}

.toc a:hover {
    color: #2196F3;
    padding-left: 8px;
}

/* レスポンシブデザイン */
@media (max-width: 768px) {
    .content {
        padding: 30px 20px;
        margin: 20px auto;
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
        scroll-margin-top: 70px;
    }

    h3 {
        font-size: 18px;
    }

    .toc {
        padding: 16px;
    }

}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .content {
        padding: 24px 16px;
        margin: 16px auto;
        border-radius: 8px;
    }

    ul, ol {
        margin-left: 20px;
    }
}

/* プリント用スタイル */
@media print {
    body {
        background: white;
    }

    .content {
        box-shadow: none;
        margin: 0;
        padding: 20px;
    }

    a {
        color: #333;
        text-decoration: underline;
    }

    .highlight {
        border: 1px solid #999;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
        color: #e0e0e0;
    }

    .content {
        background: #2d2d2d;
        color: #e0e0e0;
    }

    h1, h2, h3 {
        color: #64b5f6;
    }

    p, li {
        color: #c0c0c0;
    }

    .last-updated {
        color: #999;
        border-bottom-color: #444;
    }

    .toc {
        background: #252525;
        border-color: #444;
    }

    .toc a {
        color: #c0c0c0;
    }

    .toc a:hover {
        color: #64b5f6;
    }

    .highlight {
        background: #3a3a1a;
        border-left-color: #ffc107;
    }

    .highlight strong {
        color: #ffd966;
    }

    a {
        color: #64b5f6;
    }

    a:hover {
        color: #90caf9;
    }
}
