/* 紧凑的分类样式 */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.category-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.category-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.category-icon {
    font-size: 24px;
    color: #007bff;
    margin-bottom: 8px;
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.category-count {
    font-size: 12px;
    color: #666;
}

/* 紧凑的书籍列表样式 */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.book-card {
    background: #fff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.book-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.book-cover {
    height: 120px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    font-weight: bold;
    position: relative;
    overflow: hidden;
}

.book-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-info {
    padding: 12px;
}

.book-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 6px 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-title a {
    color: inherit;
    text-decoration: none;
}

.book-title a:hover {
    color: #007bff;
}

.book-author {
    font-size: 12px;
    color: #666;
    margin: 0 0 6px 0;
}

.book-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.book-genre {
    font-size: 11px;
    color: #007bff;
    background: rgba(0,123,255,0.1);
    padding: 2px 6px;
    border-radius: 4px;
}

.book-rating {
    font-size: 11px;
    color: #ffc107;
    display: flex;
    align-items: center;
    gap: 2px;
}

.book-stats {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #888;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .category-card {
        padding: 10px 8px;
    }
    
    .category-icon {
        font-size: 20px;
        margin-bottom: 6px;
    }
    
    .category-title {
        font-size: 12px;
    }
    
    .category-count {
        font-size: 10px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: 15px;
    }
    
    .book-cover {
        height: 100px;
    }
    
    .book-info {
        padding: 10px;
    }
    
    .book-title {
        font-size: 13px;
    }
    
    .book-author {
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}

/* 头部样式 */
.header {
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: #333;
    font-size: 18px;
    font-weight: bold;
}

.logo a:hover {
    color: #007bff;
}

.nav {
    display: flex;
    gap: 25px;
}

.nav a {
    text-decoration: none;
    color: #666;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav a:hover, .nav a.active {
    color: #007bff;
    background: rgba(0,123,255,0.1);
}

/* 优化后的登录注册按钮样式 */
.auth-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
}

.auth-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.login-btn {
    color: #007bff;
    background: rgba(0,123,255,0.1);
    border-color: rgba(0,123,255,0.2);
}

.login-btn:hover {
    background: #007bff;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,123,255,0.3);
}

.register-btn {
    color: white;
    background: #007bff;
    border-color: #007bff;
}

.register-btn:hover {
    background: #0056b3;
    border-color: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,86,179,0.3);
}

/* 用户菜单样式 */
.user-info {
    position: relative;
}

.user-menu {
    position: relative;
}

.user-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #495057;
    transition: all 0.3s ease;
}

.user-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    min-width: 160px;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.user-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    text-decoration: none;
    color: #495057;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.user-dropdown a:hover {
    background: #f8f9fa;
    color: #007bff;
}

.user-dropdown a:last-child {
    border-top: 1px solid #dee2e6;
    color: #dc3545;
}

.user-dropdown a:last-child:hover {
    background: #f8f9fa;
    color: #c82333;
}

/* 响应式头部样式 */
@media (max-width: 768px) {
    .header-content {
        padding: 10px 0;
    }
    
    .logo a {
        font-size: 16px;
    }
    
    .nav {
        gap: 15px;
    }
    
    .nav a {
        padding: 6px 8px;
        font-size: 14px;
    }
    
    .auth-btn {
        padding: 6px 12px;
        font-size: 13px;
    }
    
    .user-btn {
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .nav {
        gap: 10px;
    }
    
    .nav a {
        padding: 4px 6px;
        font-size: 12px;
    }
    
    .auth-buttons {
        gap: 6px;
    }
    
    .auth-btn {
        padding: 5px 10px;
        font-size: 12px;
        gap: 4px;
    }
    
    .auth-btn i {
        font-size: 10px;
    }
} 