html, body, * {
    box-sizing: border-box;
}
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f4f4f4;
    color: #333;
}
main {
    flex: 1;
    padding: 20px;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    width: 100%;
    box-sizing: border-box;
}
.adsense-top, .adsense-bottom {
    width: 100%;
    max-width: 100%;
    padding: 20px;
    margin: 0;
    text-align: center;
    background-color: #f9f9f9;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}
.adsense-top p, .adsense-bottom p {
    margin: 0;
}
/* Main content typography */
main h1 {
    color: #333;
    margin-bottom: 1.5rem;
}
main h2 {
    color: #444;
    margin-top: 2rem;
    margin-bottom: 1rem;
}
main p, main ul {
    line-height: 1.6;
    margin-bottom: 1rem;
}
main ul {
    padding-left: 2rem;
}
main li {
    margin-bottom: 0.5rem;
}
.content-section {
    display: none;
}
.content-section.active {
    display: block;
}
/* 메인 컨텐츠 내의 링크 스타일 */
main a {
    color: #007bff;
    text-decoration: none;
}
main a:hover {
    text-decoration: underline;
}
/* bookdata.html, dictionary.html 고유 스타일 */
/* bookdata.html에서만 body에 한글 폰트가 필요하면, body.bookdata-page { ... } 식으로 별도 지정 가능 */
.book-list, .dictionary-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
    width: 100%;
    box-sizing: border-box;
}
@media (max-width: 768px) {
    .book-list, .dictionary-list {
        grid-template-columns: 1fr;
    }
}
.book-item, .dictionary-item {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-weight: bold;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    word-break: keep-all;
    overflow-wrap: break-word;
    min-height: 80px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Sans KR', 'Malgun Gothic', '맑은 고딕', Arial, sans-serif;
}
.book-item:hover, .dictionary-item:hover {
    background-color: #d8e0e7;
    transform: translateY(-2px);
}
.detail-view {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 1000;
}
.detail-view h2 {
    color: #28a745;
    margin-top: 0;
}
.detail-field {
    margin-bottom: 15px;
    line-height: 1.6;
}
.detail-field strong {
    color: #555;
    display: inline-block;
    width: 120px;
}
.back-to-list-btn, .nav-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 8px 15px;
    font-size: 14px;
    cursor: pointer;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}
.back-to-list-btn:hover, .nav-btn:hover {
    background-color: #5a6268;
}
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}
/* dictionary.html detail-view 일부 스타일 */
.detail-view .detail-image img {
    max-width: 200px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
.detail-view .category {
    color: #666;
    font-style: italic;
}
.detail-view .navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}
.detail-view button {
    padding: 8px 16px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}
.detail-view button:hover {
    background-color: #0056b3;
}
.dictionary-item img, .book-item img {
    width: 120px;
    height: 120px;
    display: block;
    margin: 0 auto 8px auto;
}
.term-text {
    display: block;
    text-align: center;
    margin-top: 0;
    font-weight: bold;
}