/* 首页样式 */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 0;
    background: #f8f9fa;
}

.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: #333;
    font-size: 20px;
    font-weight: bold;
}

.nav {
    display: flex;
    gap: 30px;
}

.nav a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    transition: color 0.3s;
}

.nav a:hover, .nav a.active {
    color: #007bff;
}

.search-box {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 20px;
    padding: 8px 15px;
    margin-right: 15px;
}

.search-box input {
    border: none;
    background: none;
    outline: none;
    width: 200px;
    font-size: 14px;
}

.search-box button {
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
}

.main {
    padding: 30px 0;
}

.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 10px;
}

.hero h1 {
    font-size: 36px;
    margin-bottom: 15px;
}

.hero p {
    font-size: 18px;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* 优化后的英雄区域搜索框样式 */
.hero-search {
    display: flex;
    max-width: 600px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.hero-search:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.3);
}

.hero-search input {
    flex: 1;
    border: none;
    padding: 18px 25px;
    font-size: 16px;
    outline: none;
    background: transparent;
    color: #333;
    font-weight: 400;
}

.hero-search input::placeholder {
    color: #666;
    font-weight: 400;
}

.hero-search button {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    border: none;
    padding: 18px 30px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hero-search button:hover {
    background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
    transform: scale(1.05);
}

.hero-search button:active {
    transform: scale(0.98);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .hero {
        padding: 40px 20px;
    }
    
    .hero h1 {
        font-size: 28px;
        margin-bottom: 12px;
    }
    
    .hero p {
        font-size: 16px;
        margin-bottom: 25px;
    }
    
    .hero-search {
        max-width: 90%;
        margin: 0 auto;
    }
    
    .hero-search input {
        padding: 15px 20px;
        font-size: 15px;
    }
    
    .hero-search button {
        padding: 15px 25px;
        font-size: 15px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 12px;
    }
    
    .book-cover {
        height: 120px;
        font-size: 30px;
    }
    
    .book-info {
        padding: 12px;
    }
    
    .book-title {
        font-size: 15px;
    }
    
    .book-author {
        font-size: 13px;
    }
    
    .book-genre {
        font-size: 10px;
        padding: 2px 5px;
    }
    
    .book-rating {
        font-size: 12px;
    }
    
    .book-stats {
        font-size: 12px;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 30px 15px;
    }
    
    .hero h1 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .hero-search {
        max-width: 95%;
    }
    
    .hero-search input {
        padding: 12px 18px;
        font-size: 14px;
    }
    
    .hero-search button {
        padding: 12px 20px;
        font-size: 14px;
        gap: 6px;
    }
    
    .hero-search button i {
        font-size: 12px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .book-cover {
        height: 100px;
        font-size: 24px;
    }
    
    .book-info {
        padding: 10px;
    }
    
    .book-title {
        font-size: 14px;
        margin-bottom: 6px;
    }
    
    .book-author {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .book-meta {
        margin-bottom: 6px;
    }
    
    .book-genre {
        font-size: 9px;
        padding: 2px 4px;
    }
    
    .book-rating {
        font-size: 11px;
    }
    
    .book-stats {
        font-size: 11px;
        gap: 8px;
    }
}

/* 保留原有的搜索框样式作为备用 */
.search-box-large {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    background: white;
    border-radius: 25px;
    overflow: hidden;
}

.search-box-large input {
    flex: 1;
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    outline: none;
}

.search-box-large button {
    background: #007bff;
    color: white;
    border: none;
    padding: 15px 25px;
    cursor: pointer;
    font-size: 16px;
}

.books-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-header h2 {
    font-size: 24px;
    color: #333;
    margin: 0;
}

.view-all {
    color: #007bff;
    text-decoration: none;
    font-size: 14px;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.category-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
}

.category-icon {
    font-size: 40px;
    color: #007bff;
    margin-bottom: 10px;
}

.category-card h3 {
    margin: 10px 0 5px 0;
    color: #333;
}

.category-card p {
    color: #666;
    margin: 0;
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
}

.book-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.book-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.book-cover {
    height: 140px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 36px;
    font-weight: bold;
    position: relative;
}

.book-info {
    padding: 15px;
}

.book-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    line-height: 1.3;
}

.book-title a {
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-title a:hover {
    color: #007bff;
}

.book-author {
    color: #666;
    margin-bottom: 8px;
    font-size: 14px;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.book-genre {
    background: #e9ecef;
    color: #495057;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 11px;
}

.book-rating {
    color: #ffc107;
    font-size: 13px;
}

.book-stats {
    display: flex;
    gap: 12px;
    color: #666;
    font-size: 13px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007bff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error-message {
    text-align: center;
    padding: 40px;
    color: #dc3545;
}

.footer {
    background: #333;
    color: white;
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 20px;
}

.footer-section h3 {
    margin-bottom: 15px;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 8px;
}

.footer-section a {
    color: #ccc;
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 20px;
    text-align: center;
    color: #ccc;
}
