@media (max-width: 703px) {
    .toggle-btn {
        display: none !important;
    }
}
/* ===== フォント読み込み ===== */
@font-face {
    font-family: 'MainFont';
    src: url('font/FLOPDesignFont.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

/* ===== カラーテーマ ===== */
/* テーマ1: 古書図書館（デフォルト） */
:root {
    --primary-color: #8b9e7d;
    --secondary-color: #a0b392;
    --accent-color: #9b8b80;
    --accent-green: #7a8e6e;
    --text-color: #ffffff;
    --text-secondary: #e8e8e8;
    --text-muted: #b5b5b5;
    --background: #1a1a1a;
    --callout-bg: rgba(139, 158, 125, 0.15);
    --callout-border: rgba(139, 158, 125, 0.5);
    --link-color: #a0b392;
    --link-hover: #b8caa8;
    --border-color: rgba(139, 158, 125, 0.3);
    --blockquote-border: #8b9e7d;
    --blockquote-bg: rgba(139, 158, 125, 0.08);
}

.styled-heading {
    border-left: 3px solid var(--blockquote-border);
    padding-left: 1em;
    background: var(--blockquote-bg);
    padding: 0.8em 1em;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    margin: 1em 0;
}

.icon img {
    width: 1.3em;
    height: 1.3em;
}


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

body {
    font-family: 'MainFont', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-image: url('../img/back.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;

}

.header-image {
    width: 100%;
    height: 50vh; /* PCでは高めに設定 */
    background-color: rgb(245, 250, 246);
    background-image: url('../img/header.png');
    background-size: cover; /* PCでは余白なし */
    background-position: center;
    background-repeat: no-repeat;
    margin-bottom: 0;
    position: relative;
    transition: height 0.4s ease, padding-top 0.4s ease;
}

/* 閉じた状態 */
.header-image.closed {
    height: 60px;
}

/* トグルボタン */
.toggle-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    border: 2px solid #4CAF50;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: transform 0.3s ease;
    z-index: 10;
}

.toggle-btn:hover {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 1);
}

@media (max-width: 1100px) {
    .header-image {
        height: 25vh;
        background-size: contain;
        background-attachment: scroll;
    }

    .header-image.closed {
        height: 50px;
    }
}

@media (max-width: 703px) {
    .header-image {
        height: auto;
        padding-top: 20%;
        background-size: contain;
    }

    .header-image.closed {
        height: 40px;
        padding-top: 0;
    }

    .toggle-btn {
        width: 35px;
        height: 35px;
        font-size: 18px;
    }
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 2em auto 10em auto;
    gap: 2em;
    padding: 0 2em;
}

.sidebar {
    width: 250px;
    flex-shrink: 0;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.callout {
    background: var(--callout-bg);
    border-radius: 8px;
    padding: 0.7em 1em 0.5em 1em; /* 上を0.7emにして余白を減らす */
    margin-bottom: 1em;
    display: flex;
    align-items: center;
    gap: 0.5em;
    border: 1px solid var(--callout-border);
}


.menu-list {
    list-style: none;
    margin-bottom: 0.5em;
}

.menu-list li {
    margin: 0.3em 0;
}



a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    text-decoration: underline;
    color: var(--link-hover);
}

details {
    cursor: pointer;
}

summary {
    user-select: none;
    list-style: none;
    position: relative;
    padding-left: 1.5em;
}

summary::-webkit-details-marker {
    display: none;
}

summary::before {
    content: '+';
    position: absolute;
    left: 0;
    font-weight: bold;
    color: var(--text-muted);
    border: 1px solid var(--text-muted);
    width: 1em;
    height: 1em;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 2px;
    font-size: 0.9em;
}

details[open] summary::before {
    content: '−';
}

.submenu {
    list-style: disc;
    margin-left: 1.5em;
    margin-top: 0.3em;
}

hr {
    border: none;
    border-bottom: 1px solid var(--border-color);
    margin: 1em 0;
}

.note {
    color: var(--text-muted);
    font-size: 0.9em;
    margin-top: 0.5em;
}

.main-header {
    font-size: 1.1em;
}

.placeholder-image {
    width: 528px;
    max-width: 100%;
    height: 300px;
    background: linear-gradient(135deg, var(--callout-bg) 0%, color-mix(in srgb, var(--accent-color) 30%, transparent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2em 0;
    border-radius: 8px;
    color: var(--text-muted);
    border: 1px solid var(--callout-border);
}

.logo-placeholder {
    width: 240px;
    height: 100px;
    background: linear-gradient(135deg, var(--callout-bg) 0%, color-mix(in srgb, var(--accent-color) 30%, transparent) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1em 0;
    border-radius: 8px;
    color: var(--text-muted);
    border: 1px solid var(--callout-border);
}

h1 {
    font-size: 1.875rem;
    margin: 1em 0;
    font-weight: 700;
}

h2 {
    font-size: 1.5rem;
    margin: 1.5em 0 0.5em;
}

p {
    margin: 0.8em 0;
}

blockquote {
    border-left: 3px solid var(--blockquote-border);
    padding-left: 1em;
    margin: 1em 0;
    background: var(--blockquote-bg);
    padding: 0.8em 1em;
    border-radius: 4px;
}

/* チャットスタイル */
.chat-box {
    background: rgba(96, 77, 61, 0);
    border: 0px solid var(--callout-border);
    border-radius: 8px;
    padding: 1em;
    margin-bottom: 1em;
    max-width: 40em;
}

.chat-message {
    display: flex;
    gap: 1em;
    align-items: flex-start;
}

.chat-avatar-square {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    background: rgba(132, 116, 104, 0.3);
    border: 2px solid rgba(185, 168, 155, 0.5);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.avatar-image {
    font-size: 2.5em;
}

.avatar-image-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.chat-text {
    flex: 1;
    padding-top: 0.3em;
    background: rgba(110, 136, 120, 0.15);
    border: 1px solid rgba(185, 168, 155, 0.4);
    border-radius: 6px;
    padding: 0.8em 1em;
}

.chat-name {
    font-size: 1em;
    color: var(--text-secondary);
    margin-bottom: 0.5em;
    font-weight: 600;
}

.chat-dialogue {
    color: var(--text-color);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
    }
    
    .chat-avatar-square {
        width: 60px;
        height: 60px;
    }
    
    .avatar-image {
        font-size: 2em;
    }
}