/* 全体背景と中央配置 */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;

    background-image: url('book.webp');
    /* 画像ファイル名に置き換えてね */
    background-size: cover;
    /* 全体にフィットさせる */
    background-position: center;
    /* 中央寄せ */
    background-repeat: no-repeat;
    /* 繰り返しなし */

    display: flex;
    justify-content: center;
    align-items: center;
    /* 上から配置。中央にしたいなら center */
}

/* 検索フォーム */
form {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
    margin: 2rem auto 0 auto;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 1rem;
}

.centered {
    width: 500px;
    height: 100px;
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
}

/* 入力欄 */
input[type="text"] {
    padding: 0.6rem 1rem;
    width: 250px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 8px;
}

/* 検索ボタン */
input[type="submit"] {
    padding: 0.6rem 1.5rem;
    font-size: 1rem;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

input[type="submit"]:hover {
    background-color: #0056b3;
}

/* 分類リンク */
.category-link {
    margin-top: 1rem;
    font-size: 0.95rem;
}

.category-link a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s;
}

.category-link a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* 検索履歴 */
#history-container {
    color: #676767;
    margin-top: 1rem;
    text-align: left;
    width: 100%;
}

#history-list {
    color: white;
    list-style: none;
    padding-left: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.3rem;
}

#history-list li {
    background-color: #bdbdbd;
    padding: 0.3rem 0.7rem;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}

#history-list li:hover {
    background-color: #939393;
}

.result-container {
    background-color: rgba(255, 255, 255, 0.92);
    max-width: 800px;
    margin: 3rem auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* 結果テーブルの見た目 */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    background-color: #fff;
}

th,
td {
    border: 1px solid #ccc;
    padding: 0.7rem;
    text-align: left;
}

th {
    background-color: #f0f0f0;
}

/* リンク類の下部表示 */
.links {
    margin-top: 2rem;
    display: flex;
    gap: 2rem;
    justify-content: center;
}

.links a {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.links a:hover {
    color: #0056b3;
}

.category-container {
    background-color: rgba(255, 255, 255, 0.92);
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.class-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

.class-list li {
    margin: 0.6rem 0;
}

.class-list a {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
    transition: color 0.3s;
}

.class-list a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.result-container {
    background-color: rgba(255, 255, 255, 0.92);
    max-width: 600px;
    margin: 3rem auto;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.book-list {
    list-style: none;
    padding: 0;
    margin-top: 1.5rem;
}

.book-list li {
    margin-bottom: 1rem;
    padding: 0.5rem 1rem;
    background-color: #f2f2f2;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.book-list li:hover {
    background-color: #e0e0e0;
}

.book-list a {
    color: #007bff;
    font-weight: bold;
    text-decoration: none;
}

.book-list a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.author {
    font-size: 0.9rem;
    color: #555;
}

.links {
    margin-top: 2rem;
    text-align: center;
}

.links a {
    display: inline-block;
    margin: 0.3rem 0;
    color: #007bff;
    text-decoration: none;
}

.links a:hover {
    color: #0056b3;
}

.impossible {
    color: red;
    font-weight: bold;
}