/* 书籍网格布局 */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    padding: 20px 0;
    
    /* 核心代码：让容器本身居中 */
    max-width: 1000px; /* 设置一个最大宽度，防止在大屏幕上拉得太开 */
    margin-left: auto;
    margin-right: auto;
}

/* 单个书籍卡片 */
.book-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

.book-card:hover {
    transform: translateY(-5px); /* 鼠标悬停时轻微浮起 */
}

/* 封面容器 */
.book-cover {
    height: 400px; /* 你可以根据需要调整封面高度 */
    overflow: hidden; /* 超出部分隐藏 */
    background: #f0f0f0; /* 图片加载前的底色 */
}

/* 图片本身的样式 */
.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.book-info {
    padding: 15px;
}

.book-info h3 {
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.book-info p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 10px;
}

/* 链接容器：让两个按钮并排 */
.book-links {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* 按钮通用基础样式 */
.link-btn {
    flex: 1; /* 让两个按钮平分宽度 */
    text-align: center;
    padding: 8px 0;
    font-size: 0.85rem;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
    font-weight: 500;
}

/* Amazon 按钮：橙色风格 */
.amazon {
    background-color: #FF9900;
    color: white;
}

.amazon:hover {
    background-color: #e68a00;
}

/* Interactive 按钮：蓝色或紫色风格 */
.interactive {
    background-color: #007AFF;
    color: white;
}

.interactive:hover {
    background-color: #0056b3;
}

/* 适配手机：如果屏幕太窄，按钮可以上下堆叠 */
@media (max-width: 350px) {
    .book-links {
        flex-direction: column;
    }
}

header {
    /* 之前的可能是 2rem 或更厚 */
    padding: 0.1rem 5%; /* 将上下缩减为 0.1rem，左右保持 5% */
    background: #fff;
    display: flex;
    justify-content: center; /* 确保标题居中 */
    align-items: center;
}

header h1 {
    margin: 0; /* 彻底移除默认边距 */
    font-size: 1.4rem; /* 如果觉得太占地方，可以顺便把字号调小一点 */
    line-height: 1.2;
}

footer {
    text-align: center; /* 这行能让里面的 h1 及其它文本直接居中 */
}