/* css/style.css */

/* 字体 */
@font-face {
    font-family: 'AaCute';
    src: url('../font/AaCute.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* 全局样式和背景 */
body {
    font-family: 'AaCute', Arial, sans-serif;
    margin: 0;
    padding: 0;
    color: #e0e0e0;
    min-height: 100vh;
    /* background-image: url('../image/bg.png'); */
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: -1;
}

/* 入场淡入 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 容器样式 */
.container {
    max-width: 960px;
    width: 100%;
    margin: 20px auto;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    box-sizing: border-box;
}

h1 {
    text-align: center;
    color: #ffffff;
    margin-bottom: 30px;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.3);
}

.book-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

.book-item {
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 8px;
    padding: 20px;
    background-color: rgba(0, 0, 0, 0.3);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeIn 0.5s ease backwards;
}

.book-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

.book-item h2 {
    font-size: 1.5em;
    margin-top: 0;
    color: #ffffff;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
}
.book-item p {
    font-size: 0.9em;
    color: #cccccc;
    line-height: 1.6;
    margin-bottom: 15px;
}
.book-item .author {
    font-style: italic;
    color: #b0b0b0;
    margin-bottom: 8px;
}
.book-item .overview {
    flex-grow: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    /* 设置固定行高，例如 1.5 */
    line-height: 1.5;
    /* 限制 4 行 */
    -webkit-line-clamp: 4;
    /* 计算公式：line-height (1.5) * lines (4) = 6em */
    max-height: 6em;
}

.book-item a {
    display: block;
    background-color: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    margin-top: 15px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}
.book-item a:hover {
    background-color: rgba(255, 255, 255, 0.4);
    transform: scale(1.02);
}

.loading-message {
    text-align: center;
    font-size: 1.2em;
    color: #a0a0a0;
    padding: 50px;
}